summaryrefslogtreecommitdiff
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-09-28 21:39:53 +0000
committerGuy Harris <guy@alum.mit.edu>2003-09-28 21:39:53 +0000
commitb530c88a3b63b07b65c9a8eb33a7c44dadc4ecb3 (patch)
tree04ce3d032dc05aaf82b9d198aa5c2aac28ef7192 /epan/tvbuff.c
parent82d0ca7c519048ded3eef9ee6b1ff03279893624 (diff)
downloadwireshark-b530c88a3b63b07b65c9a8eb33a7c44dadc4ecb3.tar.gz
"compute_offset_length()" must, if it returns FALSE, and "exception" is
non-null, set "*exception" to the appropriate exception - its callers rely on it. Now that it does that, there's no need for "check_offset_length()" to check for a length of -1, as "compute_offset_length()" does so, and therefore "check_offset_length_no_exception()" does so. svn path=/trunk/; revision=8562
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index d1e4e0970c..19df4d86bf 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -9,7 +9,7 @@
* the data of a backing tvbuff, or can be a composite of
* other tvbuffs.
*
- * $Id: tvbuff.c,v 1.50 2003/09/10 21:19:47 gerald Exp $
+ * $Id: tvbuff.c,v 1.51 2003/09/28 21:39:53 guy Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
*
@@ -408,6 +408,10 @@ compute_offset_length(tvbuff_t *tvb, gint offset, gint length,
/* Compute the length */
if (length < -1) {
+ if (exception) {
+ /* XXX - ReportedBoundsError? */
+ *exception = BoundsError;
+ }
return FALSE;
}
else if (length == -1) {
@@ -481,10 +485,6 @@ check_offset_length(tvbuff_t *tvb, gint offset, gint length,
{
int exception = 0;
- if (length < -1) {
- THROW(BoundsError);
- }
-
if (!check_offset_length_no_exception(tvb, offset, length, offset_ptr, length_ptr, &exception)) {
g_assert(exception > 0);
THROW(exception);