aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-radius.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2017-06-14 21:01:11 +0100
committerJoão Valverde <j@v6e.pt>2017-06-14 21:05:36 +0000
commit9ed4046e0f3e8872c3adec3f11376ee392834525 (patch)
treef637a1ffe542ac5c1e7f718203b0536705679362 /epan/dissectors/packet-radius.c
parentae085f7338b356f249bbc639ce70412ece42a708 (diff)
RADIUS: Fix dissection for non-default VSA lengths
Ping-Bug: 13745 Change-Id: I1c9f69d0015ba9bea16d8300fbfd85abe110f829 Reviewed-on: https://code.wireshark.org/review/22136 Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/dissectors/packet-radius.c')
-rw-r--r--epan/dissectors/packet-radius.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index d325f2aa53..84870f401c 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -1536,7 +1536,9 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv
offset += 4;
break;
default:
- avp_vsa_type = tvb_get_guint8(tvb, offset++);
+ /* vendor->type_octets = 1; */
+ DISSECTOR_ASSERT_NOT_REACHED();
+ break;
}
if (!avp_is_extended) {
@@ -1552,7 +1554,9 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv
offset += 2;
break;
default:
- avp_vsa_len = tvb_get_guint8(tvb, offset++);
+ /* vendor->length_octets = 1; */
+ DISSECTOR_ASSERT_NOT_REACHED();
+ break;
}
avp_vsa_header_len = vendor->type_octets + vendor->length_octets + (vendor->has_flags ? 1 : 0);
} else {
@@ -1592,11 +1596,11 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv
avp_vsa_len+avp_vsa_header_len, dictionary_entry->name, avp_vsa_type);
}
- proto_tree_add_item(avp_tree, hf_radius_avp_vendor_type, tvb, vendor_offset, 1, ENC_BIG_ENDIAN);
- vendor_offset += 1;
- if (!avp_is_extended) {
- proto_tree_add_item(avp_tree, hf_radius_avp_vendor_len, tvb, vendor_offset, 1, ENC_BIG_ENDIAN);
- /* vendor_offset += 1; */
+ proto_tree_add_item(avp_tree, hf_radius_avp_vendor_type, tvb, vendor_offset, vendor->type_octets, ENC_BIG_ENDIAN);
+ vendor_offset += vendor->type_octets;
+ if (!avp_is_extended && vendor->length_octets) {
+ proto_tree_add_item(avp_tree, hf_radius_avp_vendor_len, tvb, vendor_offset, vendor->length_octets, ENC_BIG_ENDIAN);
+ /* vendor_offset += vendor->length_octets; */
}
if (show_length) {