From a80ebce3f25f56d910b3d05ef2d62aafa9e5f578 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 28 Apr 2005 04:03:30 +0000 Subject: 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 --- epan/proto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3