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-afs.c | |
parent | a9f7ef50586b671e402cf24f7175d07e18e0f180 (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.
svn path=/trunk/; revision=4656
Diffstat (limited to 'packet-afs.c')
-rw-r--r-- | packet-afs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packet-afs.c b/packet-afs.c index 81c49a9e4b..04485c4310 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs.c,v 1.40 2002/01/24 09:20:46 guy Exp $ + * $Id: packet-afs.c,v 1.41 2002/02/01 04:34:14 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -56,7 +56,7 @@ #include "packet-afs-defs.h" #include "packet-afs-macros.h" -#define GETSTR tvb_get_ptr(tvb,offset,tvb_length_remaining(tvb,offset)) +#define GETSTR tvb_get_ptr(tvb,offset,tvb_ensure_length_remaining(tvb,offset)) #define VALID_OPCODE(opcode) ((opcode >= OPCODE_LOW && opcode <= OPCODE_HIGH) || \ (opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || \ |