dcerpc-fileexp: don't THROW() an exception from a dissector

exit if the ACL length is smaller than expected

Change-Id: I86e218a31ee1d5d1cb95eb3438ca5dc1a87205d4
Reviewed-on: https://code.wireshark.org/review/15626
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
This commit is contained in:
Martin Kaiser 2016-05-26 15:53:23 +02:00
parent c046ea826c
commit 7d29f41e1e
1 changed files with 8 additions and 8 deletions

View File

@ -754,7 +754,7 @@ dissect_afsAcl (tvbuff_t *tvb, int offset,
*/
proto_item *item = NULL;
proto_tree *tree = NULL;
proto_tree *tree;
int old_offset = offset;
guint32 acl_len;
e_guid_t uuid1, defaultcell;
@ -764,10 +764,7 @@ dissect_afsAcl (tvbuff_t *tvb, int offset,
return offset;
}
if (parent_tree)
{
tree = proto_tree_add_subtree (parent_tree, tvb, offset, -1, ett_fileexp_afsAcl, &item, "afsAcl");
}
tree = proto_tree_add_subtree (parent_tree, tvb, offset, -1, ett_fileexp_afsAcl, &item, "afsAcl");
offset =
dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_fileexp_acl_len,
@ -794,10 +791,13 @@ dissect_afsAcl (tvbuff_t *tvb, int offset,
defaultcell.data4[4], defaultcell.data4[5],
defaultcell.data4[6], defaultcell.data4[7]);
offset += (acl_len - 38);
if (acl_len < 38)
{
/* XXX - exception */
return offset;
}
if (offset <= old_offset)
THROW (ReportedBoundsError);
offset += (acl_len - 38);
proto_item_set_len (item, offset-old_offset);
return offset;