diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-06-26 16:06:26 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-06-26 16:06:26 +0000 |
commit | f7d834b5649a0398309f1beb8b857dbc6672abe6 (patch) | |
tree | f762fafa8f2ddf113c7f0201264ed3113d7e5f98 | |
parent | 5efda930a65dafb5b29f7f7033b9a9cbc53b0b6c (diff) | |
download | wireshark-f7d834b5649a0398309f1beb8b857dbc6672abe6.tar.gz wireshark-f7d834b5649a0398309f1beb8b857dbc6672abe6.tar.bz2 wireshark-f7d834b5649a0398309f1beb8b857dbc6672abe6.zip |
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
-rw-r--r-- | epan/dissectors/packet-smb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index 0941f1ec71..8f5069b344 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -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; |