aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mip6.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-07-22 14:19:04 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-07-22 14:19:04 +0000
commitd5922fb41ff7816ed09bdd715c31e9f230ad352b (patch)
treee83b84230f76dc25f3534a5a61396951121a2bf5 /epan/dissectors/packet-mip6.c
parent4a84c0987e592f3be9781a5da3356a7747a49f0e (diff)
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8958 :
Highlight the right number of bytes for the PadN option data field svn path=/trunk/; revision=50787
Diffstat (limited to 'epan/dissectors/packet-mip6.c')
-rw-r--r--epan/dissectors/packet-mip6.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c
index 48d92f3a10..2d17dd0184 100644
--- a/epan/dissectors/packet-mip6.c
+++ b/epan/dissectors/packet-mip6.c
@@ -1855,13 +1855,18 @@ dissect_mip6_opt_padn(const mip6_opt *optp, tvbuff_t *tvb, int offset,
guint optlen, packet_info *pinfo _U_,
proto_tree *opt_tree, proto_item *hdr_item _U_ )
{
+ guint8 len;
+
/* offset points to tag(opt) */
offset++;
+ len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(opt_tree, hf_mip6_opt_len, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- proto_tree_add_text(opt_tree, tvb, offset, optlen,
- "%s: %u bytes", optp->name, optlen);
+ if (len > 0) {
+ proto_tree_add_text(opt_tree, tvb, offset, len,
+ "%s: %u bytes", optp->name, len);
+ }
}
/* 2 Binding Refresh Advice */