aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dhcpv6.c
diff options
context:
space:
mode:
authorcmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-27 14:38:42 +0000
committercmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-27 14:38:42 +0000
commit159fb7b63b7dc5828a920694cc2fdfa2132b9bd8 (patch)
tree33e102b2a2f0b50bf2d34787c5d7949a381533b5 /epan/dissectors/packet-dhcpv6.c
parent53fa19f278b3bd9a721a928af595e73b41f4371e (diff)
When parsing OPTION_REMOTE_ID, don't modify optlen or we'll return the wrong
number of bytes consumed. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5962 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37439 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dhcpv6.c')
-rw-r--r--epan/dissectors/packet-dhcpv6.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index 48823f8cfd..9fb68cd84b 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -986,7 +986,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, tvbuff_t *tvb, int voff, int
}
sub_off += field_len;
break;
-
+
case CL_OPTION_CORRELATION_ID :
opt_len = tlv_len;
if (tlv_len != 4) {
@@ -1602,9 +1602,8 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
}
proto_tree_add_item(subtree, hf_remoteid_enterprise, tvb, off, 4, FALSE);
off += 4;
- optlen -= 4;
- buf = tvb_bytes_to_str(tvb, off, optlen);
- proto_tree_add_text(subtree, tvb, off, optlen, "Remote-ID: %s", buf);
+ buf = tvb_bytes_to_str(tvb, off, optlen - 4);
+ proto_tree_add_text(subtree, tvb, off, optlen - 4, "Remote-ID: %s", buf);
break;
case OPTION_SUBSCRIBER_ID:
if (optlen == 0) {