aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-28 04:03:30 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-28 04:03:30 +0000
commita80ebce3f25f56d910b3d05ef2d62aafa9e5f578 (patch)
treea9f993f828d97de98342de1df1393182d0503372
parent338bf987f61e3eb8eea134d279bee905f9c88c90 (diff)
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
-rw-r--r--epan/proto.c4
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);