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
This commit is contained in:
Gerald Combs 2005-04-28 04:03:30 +00:00
parent 338bf987f6
commit a80ebce3f2
1 changed files with 3 additions and 1 deletions

View File

@ -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);