aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/proto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 1f6b7a1ede..2851f5d5e9 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -2134,7 +2134,9 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
* additional routines that take no length argument and
* add fields that run to the end of the tvbuff.
*/
- if (*length == -1) {
+ if (*length < -1) {
+ THROW(ReportedBoundsError);
+ } else if (*length == -1) {
/*
* For FT_NONE, FT_PROTOCOL, FT_BYTES, and FT_STRING fields,
* a length of -1 means "set the length to what remains in