aboutsummaryrefslogtreecommitdiffstats
path: root/packet-auto_rp.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-01 04:34:17 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-01 04:34:17 +0000
commitcaea2d0e0e122b2bc971a922f502ac6fd8cf1118 (patch)
tree65878dfe4ebb3e9f077e408a572bc9227a524ded /packet-auto_rp.c
parenta64e527e76bc83b5d0514307cac94f85598f3b29 (diff)
Provide tvb_ensure_length_remaining(), which is like
tvb_length_remaining() except that it throws BoundsError if 'offset' is out-of-bounds. Allow a length argument of -1 for FT_STRING and FT_BYTES fields in proto_tree_add_item(). Change some dissectors to either use -1 for the length argument in calls to proto_tree_add_item(), or call tvb_ensure_length_remaining() instead of tvb_length_remaining(), or to check the return-value of tvb_length_remaining(). Changes to more dissectors are necessary, but will follow later. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4656 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-auto_rp.c')
-rw-r--r--packet-auto_rp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/packet-auto_rp.c b/packet-auto_rp.c
index 683e214ee7..d90a20bf99 100644
--- a/packet-auto_rp.c
+++ b/packet-auto_rp.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-auto_rp.c,v 1.18 2002/01/24 09:20:47 guy Exp $
+ * $Id: packet-auto_rp.c,v 1.19 2002/02/01 04:34:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -169,7 +169,7 @@ static void dissect_auto_rp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = do_auto_rp_map(tvb, offset, auto_rp_tree);
if (tvb_length_remaining(tvb, offset) > 0)
- proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Trailing junk");
+ proto_tree_add_text(tree, tvb, offset, -1, "Trailing junk");
}
return;