aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCal Turney <cal.turney@emc.com>2013-10-10 15:53:45 +0000
committerCal Turney <cal.turney@emc.com>2013-10-10 15:53:45 +0000
commit943356c9f4f54612e2c3a59d58dd10cc1d69f893 (patch)
treed9153e4fbcb1ab141cd37dea071645d433b62a75
parentbcf51e813132b628898705e09c0e3992876aaec1 (diff)
"Expert Info (Error/Malformed) trying to fetch an unsigned integer with length 0" errors when an attempt is made to display the File Attributes within the FID subtree of SMB requests and responses. In addition, not all the options and masks were marked with PROTO_ITEM_SET_GENERATED(item) when appropriate to do so;
Fix1: The proto_tree_add_item() was changed to proto_tree_add_uint. Fix2: "If (len==0) PROTO_ITEM_SET_GENERATED(item);" was added to dissect_nt_create_options_bits(), dissect_nt_share_access_bits(), dissect_smb_access_mask_bits(), dissect_nt_create_bits(), and dissect_file_ext_attr_bits(). svn path=/trunk/; revision=52494
-rw-r--r--epan/dissectors/packet-smb.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 1010c09315..70d0960973 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -1816,9 +1816,10 @@ dissect_file_ext_attr_bits(tvbuff_t *tvb, proto_tree *parent_tree, int offset,
proto_tree *tree;
if (parent_tree) {
- item = proto_tree_add_item(parent_tree, hf_smb_file_eattr, tvb, offset, len, ENC_LITTLE_ENDIAN);
+ item = proto_tree_add_uint(parent_tree, hf_smb_file_eattr, tvb, offset, len, mask);
tree = proto_item_add_subtree(item, ett_smb_file_attributes);
-
+ if (len==0)
+ PROTO_ITEM_SET_GENERATED(item);
/*
* XXX - Network Monitor disagrees on some of the
* bits, e.g. the bits above temporary are "atomic write"
@@ -3359,6 +3360,8 @@ dissect_nt_create_bits(tvbuff_t *tvb, proto_tree *parent_tree, int offset,
item = proto_tree_add_uint(parent_tree, hf_smb_create_flags, tvb, offset, len, mask);
tree = proto_item_add_subtree(item, ett_smb_nt_create_bits);
+ if (len==0)
+ PROTO_ITEM_SET_GENERATED(item);
}
/*
@@ -3398,7 +3401,8 @@ dissect_smb_access_mask_bits(tvbuff_t *tvb, proto_tree *parent_tree,
if (parent_tree) {
item = proto_tree_add_uint(parent_tree, hf_smb_access_mask, tvb, offset, len, mask);
tree = proto_item_add_subtree(item, ett_smb_nt_access_mask);
-
+ if (len==0)
+ PROTO_ITEM_SET_GENERATED(item);
/*
* Some of these bits come from
*
@@ -3480,6 +3484,8 @@ dissect_nt_share_access_bits(tvbuff_t *tvb, proto_tree *parent_tree,
if (parent_tree) {
item = proto_tree_add_uint(parent_tree, hf_smb_share_access, tvb, offset, len, mask);
tree = proto_item_add_subtree(item, ett_smb_nt_share_access);
+ if (len==0)
+ PROTO_ITEM_SET_GENERATED(item);
proto_tree_add_boolean(tree, hf_smb_nt_share_access_delete,
tvb, offset, len, mask);
@@ -3528,7 +3534,8 @@ dissect_nt_create_options_bits(tvbuff_t *tvb, proto_tree *parent_tree,
if (parent_tree) {
item = proto_tree_add_uint(parent_tree, hf_smb_create_options, tvb, offset, len, mask);
tree = proto_item_add_subtree(item, ett_smb_nt_create_options);
-
+ if (len==0)
+ PROTO_ITEM_SET_GENERATED(item);
/*
* From
*