diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-11-25 21:55:34 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-11-25 21:55:34 +0000 |
commit | 85cfb618f9ced22b5b413610820c11fdaec7d658 (patch) | |
tree | 349eb89fdacbf43fde3dccad6d512093ab999d45 /epan/dissectors | |
parent | 00728fb58705cf7a611a89a1597d2c8c55ce5b05 (diff) |
from metze and modified, fix for in offset/length for transaction request
svn path=/trunk/; revision=16589
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-smb.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-smb2.c | 56 |
2 files changed, 41 insertions, 17 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index c2bcd1cea6..31e290fc9b 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -10958,7 +10958,7 @@ dissect_qfi_SMB_FILE_NETWORK_OPEN_INFO(tvbuff_t *tvb, return offset; } -/* this dissects the SMB_QUERY_FILE_NETWORK_OPEN_INFO +/* this dissects the SMB_FILE_ATTRIBUTE_TAG_INFO */ int dissect_qfi_SMB_FILE_ATTRIBUTE_TAG_INFO(tvbuff_t *tvb, diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index 59203d7ebf..47a6bce3be 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -2045,13 +2045,13 @@ dissect_smb2_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree * /* out buffer offset/length */ offset = dissect_smb2_olb_length_offset(tvb, offset, &o_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_out_data); - /* in buffer offset/length */ - offset = dissect_smb2_olb_length_offset(tvb, offset, &i_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_in_data); - /* some unknown bytes */ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 4, TRUE); offset += 4; + /* in buffer offset/length */ + offset = dissect_smb2_olb_length_offset(tvb, offset, &i_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_in_data); + /* max transaction in size */ proto_tree_add_item(tree, hf_smb2_max_transaction_in_size, tvb, offset, 4, TRUE); offset += 4; @@ -2060,11 +2060,24 @@ dissect_smb2_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree * proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 8, TRUE); offset += 8; - /* out buffer */ - dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data); + /* try to decode these blobs in the order they were encoded + * so that for "short" packets we will dissect as much as possible + * before aborting with "short packet" + */ + if(i_olb.off>o_olb.off){ + /* out buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data); + /* in buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &i_olb, si, NULL); + } else { + /* in buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &i_olb, si, NULL); + /* out buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data); + } - /* in buffer */ - dissect_smb2_olb_buffer(pinfo, tree, tvb, &i_olb, si, NULL); + offset = dissect_smb2_olb_tvb_max_offset(offset, &o_olb); + offset = dissect_smb2_olb_tvb_max_offset(offset, &i_olb); return offset; } @@ -2085,23 +2098,34 @@ dissect_smb2_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* fid */ offset = dissect_smb2_fid(tvb, pinfo, tree, offset, si, FID_MODE_USE); - /* out buffer offset/length */ - offset = dissect_smb2_olb_length_offset(tvb, offset, &o_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_out_data); - /* in buffer offset/length */ offset = dissect_smb2_olb_length_offset(tvb, offset, &i_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_in_data); + /* out buffer offset/length */ + offset = dissect_smb2_olb_length_offset(tvb, offset, &o_olb, OLB_O_UINT32_S_UINT32, hf_smb2_transaction_out_data); + /* some unknown bytes */ proto_tree_add_item(tree, hf_smb2_unknown, tvb, offset, 8, TRUE); offset += 8; + /* try to decode these blobs in the order they were encoded + * so that for "short" packets we will dissect as much as possible + * before aborting with "short packet" + */ + if(i_olb.off>o_olb.off){ + /* out buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data); + /* in buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &i_olb, si, dissect_smb2_transaction_data); + } else { + /* in buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &i_olb, si, dissect_smb2_transaction_data); + /* out buffer */ + dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data); + } - /* out buffer */ - dissect_smb2_olb_buffer(pinfo, tree, tvb, &o_olb, si, dissect_smb2_transaction_data); - - /* in buffer */ - dissect_smb2_olb_buffer(pinfo, tree, tvb, &i_olb, si, dissect_smb2_transaction_data); - + offset = dissect_smb2_olb_tvb_max_offset(offset, &i_olb); + offset = dissect_smb2_olb_tvb_max_offset(offset, &o_olb); return offset; } |