diff options
author | Gerald Combs <gerald@wireshark.org> | 2005-04-28 04:03:30 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2005-04-28 04:03:30 +0000 |
commit | a80ebce3f25f56d910b3d05ef2d62aafa9e5f578 (patch) | |
tree | a9f993f828d97de98342de1df1393182d0503372 /epan/proto.c | |
parent | 338bf987f61e3eb8eea134d279bee905f9c88c90 (diff) | |
download | wireshark-a80ebce3f25f56d910b3d05ef2d62aafa9e5f578.tar.gz wireshark-a80ebce3f25f56d910b3d05ef2d62aafa9e5f578.tar.bz2 wireshark-a80ebce3f25f56d910b3d05ef2d62aafa9e5f578.zip |
Some dissectors apparently call proto_tree_add_*() with a null tvb.
This makes tvb_ensure_bytes_exist() throw a fit, so just throw an
exception instead.
svn path=/trunk/; revision=14212
Diffstat (limited to 'epan/proto.c')
-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 c164cbbb08..a763946493 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -2235,7 +2235,9 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, item_length = length_remaining; } } - tvb_ensure_bytes_exist(tvb, start, item_length); + if (item_length < 0) { + THROW(ReportedBoundsError); + } } FIELD_INFO_NEW(fi); |