aboutsummaryrefslogtreecommitdiffstats
path: root/packet-gprs-ns.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-09 09:20:07 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-09 09:20:07 +0000
commit49f240d3d597d1ceddcda785cd41d479475b003c (patch)
treed04f448a6b321ab93499195c00a6b94494360a6d /packet-gprs-ns.c
parent4065d401c1f3590917eb8a11332c192403f94d57 (diff)
If the uppermost bit of the first length octet is set, it means that the
length is in the lower 7 bits of that octet, not that there's another octet of length. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8431 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-gprs-ns.c')
-rw-r--r--packet-gprs-ns.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/packet-gprs-ns.c b/packet-gprs-ns.c
index a001feeb2d..4264bb93b6 100644
--- a/packet-gprs-ns.c
+++ b/packet-gprs-ns.c
@@ -3,7 +3,7 @@
* dissection
* Copyright 2003, Josef Korelus <jkor@quick.cz>
*
- * $Id: packet-gprs-ns.c,v 1.4 2003/09/09 08:53:48 guy Exp $
+ * $Id: packet-gprs-ns.c,v 1.5 2003/09/09 09:20:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -120,8 +120,16 @@ process_tlvs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
length_len = 1;
length = tvb_get_guint8(tvb, offset);
if (length & 0x80) {
+ /*
+ * This is the final octet of the length.
+ */
+ length &= 0x7F;
+ } else {
+ /*
+ * One more octet.
+ */
length_len++;
- length = ((length & 0x7F) << 8) | tvb_get_guint8(tvb, offset);
+ length = (length << 8) | tvb_get_guint8(tvb, offset);
}
proto_tree_add_uint(tree, hf_gprs_ns_ie_length,
tvb, offset, length_len, length);