diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2002-02-01 04:34:17 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2002-02-01 04:34:17 +0000 |
commit | bd4a9c13eb557b93f3e80f2c66226cbfe6082a82 (patch) | |
tree | 65878dfe4ebb3e9f077e408a572bc9227a524ded /packet-auto_rp.c | |
parent | a9f7ef50586b671e402cf24f7175d07e18e0f180 (diff) | |
download | wireshark-bd4a9c13eb557b93f3e80f2c66226cbfe6082a82.tar.gz wireshark-bd4a9c13eb557b93f3e80f2c66226cbfe6082a82.tar.bz2 wireshark-bd4a9c13eb557b93f3e80f2c66226cbfe6082a82.zip |
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.
svn path=/trunk/; revision=4656
Diffstat (limited to 'packet-auto_rp.c')
-rw-r--r-- | packet-auto_rp.c | 4 |
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; |