From cf3ac5e7819cb86cdcb0586e198aadbf9b47adb5 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Fri, 4 Oct 2013 10:29:57 +0000 Subject: 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 --- epan/dissectors/packet-sip.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'epan/dissectors/packet-sip.c') 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); -- cgit v1.2.3