aboutsummaryrefslogtreecommitdiffstats
path: root/packet-beep.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2002-02-01 04:34:17 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2002-02-01 04:34:17 +0000
commitbd4a9c13eb557b93f3e80f2c66226cbfe6082a82 (patch)
tree65878dfe4ebb3e9f077e408a572bc9227a524ded /packet-beep.c
parenta9f7ef50586b671e402cf24f7175d07e18e0f180 (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-beep.c')
-rw-r--r--packet-beep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/packet-beep.c b/packet-beep.c
index 1cd338ec5f..2507f2995f 100644
--- a/packet-beep.c
+++ b/packet-beep.c
@@ -1,7 +1,7 @@
/* packet-beep.c
* Routines for BEEP packet disassembly
*
- * $Id: packet-beep.c,v 1.4 2002/01/24 09:20:47 guy Exp $
+ * $Id: packet-beep.c,v 1.5 2002/02/01 04:34:15 gram Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
* Modified 2001 Darren New <dnew@invisible.net> for BEEP.
@@ -395,7 +395,7 @@ static int header_len(tvbuff_t *tvb, int offset)
while (1) {
- if (tvb_length_remaining(tvb, offset + i) < 1)
+ if (tvb_ensure_length_remaining(tvb, offset + i) < 1)
return i; /* Not enough characters left ... */
if ((sc = tvb_get_guint8(tvb, offset + i)) == 0x0d