diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-11-27 05:14:04 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-11-27 05:14:04 +0000 |
commit | ceccbe5e4c788d84316fc94c514fd5721a7c311a (patch) | |
tree | 683774d87b61e7f2f5c507427c31f581753e43f6 /packet-smb-mailslot.c | |
parent | c2717b1eb64928e8b05e263acf48bf2dbdd1d533 (diff) |
Fixes from Ronnie Sahlberg for fragmented transactions - handle null
tvbuff pointers.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4279 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-smb-mailslot.c')
-rw-r--r-- | packet-smb-mailslot.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/packet-smb-mailslot.c b/packet-smb-mailslot.c index f0e49fca3d..9f62edaff6 100644 --- a/packet-smb-mailslot.c +++ b/packet-smb-mailslot.c @@ -2,7 +2,7 @@ * Routines for SMB mailslot packet dissection * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-smb-mailslot.c,v 1.25 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-smb-mailslot.c,v 1.26 2001/11/27 05:14:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -77,8 +77,8 @@ dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb, smb_info_t *smb_info; smb_transact_info_t *tri; int trans_subcmd; - proto_tree *tree = 0; - proto_item *item; + proto_tree *tree = NULL; + proto_item *item = NULL; guint16 opcode; int offset = 0; int len; @@ -99,6 +99,10 @@ dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb, return TRUE; } + if (check_col(pinfo->fd, COL_INFO)) { + col_clear(pinfo->fd, COL_INFO); + } + smb_info = pinfo->private_data; if (smb_info->sip != NULL) tri = smb_info->sip->extra_info; @@ -123,18 +127,24 @@ dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb, if (tri != NULL) tri->trans_subcmd = trans_subcmd; - /* do the opcode field */ - opcode = tvb_get_letohs(setup_tvb, offset); - - if (check_col(pinfo->fd, COL_INFO)) { - col_add_str(pinfo->fd, COL_INFO, - val_to_str(opcode, opcode_vals, "Unknown opcode: 0x%04x")); - } - if (parent_tree) { item = proto_tree_add_item(parent_tree, proto_smb_msp, mshdr_tvb, 0, tvb_length(mshdr_tvb), FALSE); tree = proto_item_add_subtree(item, ett_smb_msp); + } + + /* Only do these ones if we have them. For fragmented SMB Transactions + we may only have the setup area for the first fragment + */ + if(mshdr_tvb && setup_tvb){ + /* do the opcode field */ + opcode = tvb_get_letohs(setup_tvb, offset); + + if (check_col(pinfo->fd, COL_INFO)) { + col_add_str(pinfo->fd, COL_INFO, + val_to_str(opcode, opcode_vals, "Unknown opcode: 0x%04x")); + } + /* These are in the setup words; use "setup_tvb". */ @@ -156,6 +166,7 @@ dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb, starts at the same place "setup_tvb" does. */ /* size */ + /* this is actually bytecount in the SMB Transaction command */ proto_tree_add_item(tree, hf_size, mshdr_tvb, offset, 2, TRUE); offset += 2; |