diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-10-04 10:29:57 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-10-04 10:29:57 +0000 |
commit | cf3ac5e7819cb86cdcb0586e198aadbf9b47adb5 (patch) | |
tree | 4925ca033f308715f1776114b1601b6ca9cca1c0 /epan/dissectors/packet-sip.c | |
parent | 2ab20bf491949d49d711a9dadd2bfb61030f8475 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9228 :
Ensure that decompressed tvb exists before trying to add it to the tree
svn path=/trunk/; revision=52354
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r-- | epan/dissectors/packet-sip.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 23c54dcf8a..a6a63f19e4 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -3176,11 +3176,20 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr !strncmp(content_encoding_parameter_str,"deflate",7))){ /* The body is gzip:ed */ next_tvb = tvb_uncompress(tvb, offset, datalen); - add_new_data_source(pinfo, next_tvb, "gunziped data"); - if(sip_tree) { - ti_a = proto_tree_add_item(sip_tree, hf_sip_msg_body, next_tvb, 0, -1, - ENC_NA); - message_body_tree = proto_item_add_subtree(ti_a, ett_sip_message_body); + if (next_tvb) { + add_new_data_source(pinfo, next_tvb, "gunziped data"); + if(sip_tree) { + ti_a = proto_tree_add_item(sip_tree, hf_sip_msg_body, next_tvb, 0, -1, + ENC_NA); + message_body_tree = proto_item_add_subtree(ti_a, ett_sip_message_body); + } + } else { + next_tvb = tvb_new_subset(tvb, offset, datalen, reported_datalen); + if(sip_tree) { + ti_a = proto_tree_add_item(sip_tree, hf_sip_msg_body, next_tvb, 0, -1, + ENC_NA); + message_body_tree = proto_item_add_subtree(ti_a, ett_sip_message_body); + } } }else{ next_tvb = tvb_new_subset(tvb, offset, datalen, reported_datalen); |