Validate 'offset' before calling proto_item_set_end(); prevents potential 'Dissector Bug' msg

Addresses comment in Bug #7390 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7390#c1

svn path=/trunk/; revision=43496
This commit is contained in:
Bill Meier 2012-06-26 16:06:26 +00:00
parent 5efda930a6
commit f7d834b564

View file

@ -16988,6 +16988,10 @@ dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *s
smb_dissector[cmd].request:smb_dissector[cmd].response;
offset = (*dissector)(tvb, pinfo, cmd_tree, offset, smb_tree);
if (!tvb_offset_exists(tvb, offset-1)) {
THROW(ReportedBoundsError);
}
proto_item_set_end(cmd_item, tvb, offset);
}
return offset;