diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-08-23 08:49:57 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-08-23 08:49:57 +0000 |
commit | f95233a8893c8873a288efb06263822587510314 (patch) | |
tree | f14ccbd5746507bc7522acb00060a5bec60d579b /epan | |
parent | a7933c7cc51e28d5fb88078b99f3301257e0f17b (diff) |
The name in a Display TLV is null-terminated (or padded with a null byte
and extra crud).
Don't bother with length checking on the VLAN name item - if it's
zero-length, so be it.
svn path=/trunk/; revision=15516
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-extreme.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c index 09b33c3905..2e5c133ab1 100644 --- a/epan/dissectors/packet-extreme.c +++ b/epan/dissectors/packet-extreme.c @@ -341,17 +341,22 @@ dissect_display_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, p { proto_item *display_item; proto_tree *display_tree; + guint8 *display_name; - display_item = proto_tree_add_protocol_format(tree, hf_edp_display, - tvb, offset, length, "Display: \"%s\"", - tvb_format_text(tvb, offset + 0 + 4, length - (0 + 4))); + display_item = proto_tree_add_item(tree, hf_edp_display, + tvb, offset, length, FALSE); display_tree = proto_item_add_subtree(display_item, ett_edp_display); dissect_tlv_header(tvb, pinfo, offset, 4, display_tree); offset += 4; - proto_tree_add_item(display_tree, hf_edp_display_string, tvb, offset, length - 4, - FALSE); + length -= 4; + + display_name = tvb_get_ephemeral_string(tvb, offset, length); + proto_item_append_text(display_item, ": \"%s\"", + format_text(display_name, strlen(display_name))); + proto_tree_add_string(display_tree, hf_edp_display_string, tvb, offset, length, + display_name); } static void @@ -538,12 +543,6 @@ dissect_vlan_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, prot offset += 4; length -= 4; - if (length < 1) { - too_short_item = proto_tree_add_text(vlan_tree, tvb, 0, 0, - "TLV is too short"); - PROTO_ITEM_SET_GENERATED(too_short_item); - return; - } vlan_name = tvb_get_ephemeral_string(tvb, offset, length); proto_item_append_text(vlan_item, ", Name \"%s\"", format_text(vlan_name, strlen(vlan_name))); |