aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-stun.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-09-09 05:16:39 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-09-09 05:16:39 +0000
commitffbc2dc5ba0279280395104cec20937548af698b (patch)
treeaef5cd8a133d20a1e7e267aeebb0d1cccb4a97ed /epan/dissectors/packet-stun.c
parent9d73a1162f64ded585047a80e80c35d5fcdda991 (diff)
From Ken Cox:
The change causes dissect_stun_message() to pass control to subdissectors when 'tree' is NULL. Part of the patch from https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6322 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38949 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-stun.c')
-rw-r--r--epan/dissectors/packet-stun.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index 6280793be4..1899855957 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -440,17 +440,19 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Clear out stuff in the info column */
col_set_str(pinfo->cinfo, COL_INFO, "ChannelData TURN Message");
- if (!tree)
- return tvb_length(tvb);
- ti = proto_tree_add_item(
- tree, proto_stun, tvb, 0,
- CHANNEL_DATA_HDR_LEN,
- FALSE);
- proto_item_append_text(ti, ", TURN ChannelData Message");
- stun_tree = proto_item_add_subtree(ti, ett_stun);
- proto_tree_add_item(stun_tree, hf_stun_channel, tvb, offset, 2, FALSE); offset += 2;
- data_length = tvb_get_ntohs(tvb, 2);
- proto_tree_add_item(stun_tree, hf_stun_length, tvb, offset, 2, FALSE); offset += 2;
+ if (tree) {
+ ti = proto_tree_add_item(
+ tree, proto_stun, tvb, 0,
+ CHANNEL_DATA_HDR_LEN,
+ FALSE);
+ proto_item_append_text(ti, ", TURN ChannelData Message");
+ stun_tree = proto_item_add_subtree(ti, ett_stun);
+ proto_tree_add_item(stun_tree, hf_stun_channel, tvb, offset, 2, FALSE); offset += 2;
+ data_length = tvb_get_ntohs(tvb, 2);
+ proto_tree_add_item(stun_tree, hf_stun_length, tvb, offset, 2, FALSE); offset += 2;
+ } else {
+ data_length = tvb_get_ntohs(tvb, 2);
+ }
new_len = tvb_length_remaining(tvb, CHANNEL_DATA_HDR_LEN);