aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.h
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-10-12 18:13:26 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-10-12 18:13:26 +0000
commitb610734a12a4fbdfddfa777c7444d6896b94093f (patch)
tree03fb8387d3ef922238dce52242344ba564ef67d9 /epan/tvbuff.h
parent65accd3c18b449f6f06758e2f80c50eabfd384dd (diff)
If the offset is out of bounds, have tvb_length_remaining() and tvb_reported_length_remaining() return 0 instead of -1. This should provide a better long-term fix for bugs/problems such as seen in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9263. In the long-run, if we like this behavior, we can change the return value to a guint as well. Let's let it simmer for awhile first ...
svn path=/trunk/; revision=52571
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r--epan/tvbuff.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index 0646fcef38..7fef12da6b 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -221,8 +221,8 @@ WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t* tvb);
WS_DLL_PUBLIC guint tvb_length(const tvbuff_t*);
/** Computes bytes to end of buffer, from offset (which can be negative,
- * to indicate bytes from end of buffer). Function returns -1 to
- * indicate that offset is out of bounds. No exception is thrown. */
+ * to indicate bytes from end of buffer). Function returns 0 if offset is out
+ * of bounds. No exception is thrown. */
WS_DLL_PUBLIC gint tvb_length_remaining(const tvbuff_t*, const gint offset);
/** Same as above, but throws an exception if the offset is out of bounds. */
@@ -244,8 +244,7 @@ WS_DLL_PUBLIC guint tvb_reported_length(const tvbuff_t*);
/** Computes bytes of reported packet data to end of buffer, from offset
* (which can be negative, to indicate bytes from end of buffer). Function
- * returns -1 to indicate that offset is out of bounds. No exception is
- * thrown. */
+ * returns 0 if offset is out of bounds. No exception is thrown. */
WS_DLL_PUBLIC gint tvb_reported_length_remaining(const tvbuff_t *tvb, const gint offset);
/** Set the reported length of a tvbuff to a given value; used for protocols