aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nbns.c
diff options
context:
space:
mode:
authorcmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2010-11-02 18:43:26 +0000
committercmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2010-11-02 18:43:26 +0000
commit35a1fcd950e796f5d740347c0d95de2bbd0ed493 (patch)
treece711b8e4d2adea8ffb27213caf7a09c3bd720cd /epan/dissectors/packet-nbns.c
parentdb921c19ac07ad55a8d7bae732c4796639dc9f15 (diff)
Removed call to proto_item_set_len() for SESSION_MESSAGE case. Protect some
other of these calls with "if (ti != NULL)". Fixes bug 5289. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34755 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-nbns.c')
-rw-r--r--epan/dissectors/packet-nbns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index 033d754ba8..db84efed65 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -1318,7 +1318,8 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*
* XXX - take the datagram length into account?
*/
- proto_item_set_len(ti, offset);
+ if (ti != NULL)
+ proto_item_set_len(ti, offset);
next_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_netbios_payload(next_tvb, pinfo, tree);
break;
@@ -1329,7 +1330,8 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(header.error_code, error_codes, "Unknown (0x%x)"));
}
offset += 1;
- proto_item_set_len(ti, offset);
+ if (ti != NULL)
+ proto_item_set_len(ti, offset);
break;
case NBDS_QUERY_REQUEST:
@@ -1343,7 +1345,8 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Destination name", name, name_type);
}
offset += len;
- proto_item_set_len(ti, offset);
+ if (ti != NULL)
+ proto_item_set_len(ti, offset);
break;
}
}
@@ -1578,7 +1581,6 @@ dissect_nbss_packet(tvbuff_t *tvb, int offset, packet_info *pinfo,
* Set the length of our top-level tree item to include
* only our stuff.
*/
- proto_item_set_len(ti, offset);
len = tvb_length_remaining(tvb, offset);
reported_len = tvb_reported_length_remaining(tvb, offset);
if (len > length)