diff options
author | Gerald Combs <gerald@wireshark.org> | 2005-04-27 16:22:24 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2005-04-27 16:22:24 +0000 |
commit | 5ec0554c2475bbdbf0f863dfa58f6f7fc6789ddb (patch) | |
tree | cbab46e427c6163d52d3d33c968456cb5236aac6 | |
parent | 130db4f23cb03122ec09306c9a498808561f2bc8 (diff) |
In alloc_field_info, throw a ReportedBoundsError if we're passed an
invalid length.
svn path=/trunk/; revision=14203
-rw-r--r-- | epan/proto.c | 4 |
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 |