diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-09-09 05:16:39 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-09-09 05:16:39 +0000 |
commit | ffbc2dc5ba0279280395104cec20937548af698b (patch) | |
tree | aef5cd8a133d20a1e7e267aeebb0d1cccb4a97ed /epan/dissectors/packet-stun.c | |
parent | 9d73a1162f64ded585047a80e80c35d5fcdda991 (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.c | 24 |
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); |