aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb2.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2007-05-15 20:46:45 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2007-05-15 20:46:45 +0000
commit99c98d6c6e1a723b6c6cf5f01060e5c98d68cdf1 (patch)
tree40cd09a065030811b15ebd7e041177ba03e995bd /epan/dissectors/packet-smb2.c
parent827df92fb1ab56f9ad3b89dc53bc168b3b1b13c4 (diff)
when spawning off to the next smb2 pdu in a chain we need to create a
new tvb for it or else the offset/length calculations for where blobs a next_tvb=tvb_new_subset(tvb, chain_offset, MIN((int)len, tvb_length_remaining(tvb, off)), len); re in the packets are wrong. svn path=/trunk/; revision=21795
Diffstat (limited to 'epan/dissectors/packet-smb2.c')
-rw-r--r--epan/dissectors/packet-smb2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index f180b3c443..dc5b4875d1 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -4453,9 +4453,14 @@ dissect_smb2(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_t
offset = dissect_smb2_command(pinfo, tree, tvb, offset, si);
if (chain_offset > 0) {
- if ((old_offset+chain_offset) < offset)
+ tvbuff_t *next_tvb;
+
+ if ((old_offset+chain_offset) < offset) {
THROW(ReportedBoundsError);
- offset = dissect_smb2(tvb, old_offset+chain_offset, pinfo, parent_tree);
+ }
+
+ next_tvb = tvb_new_subset(tvb, chain_offset, -1, -1);
+ offset = dissect_smb2(next_tvb, 0, pinfo, parent_tree);
}
return offset;