diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-11-18 16:56:31 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-11-18 16:56:31 +0000 |
commit | 567ee3e08380fca08b272aae2932062148de7804 (patch) | |
tree | c1d26dd1f102e5bc9d23a70e69977ac9cc76ebee | |
parent | ea00ad9f58f27422fb9729195262d018bf4978f2 (diff) | |
download | wireshark-567ee3e08380fca08b272aae2932062148de7804.tar.gz |
dissect_sip() was incorrectly always calling the next level
dissector when tree was NULL.
From Heikki Vatiainen <hessu@cs.tut.fi>
svn path=/trunk/; revision=2661
-rw-r--r-- | packet-sip.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packet-sip.c b/packet-sip.c index f671f4042f..304df56253 100644 --- a/packet-sip.c +++ b/packet-sip.c @@ -7,7 +7,7 @@ * * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-sip.c,v 1.6 2000/11/16 07:35:38 guy Exp $ + * $Id: packet-sip.c,v 1.7 2000/11/18 16:56:31 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -92,6 +92,9 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_format_text(tvb, 0, eol - strlen(" SIP/2.0")) : tvb_format_text(tvb, strlen("SIP/2.0 "), eol - strlen("SIP/2.0 "))); + msg_offset = sip_get_msg_offset(tvb, offset); + if (msg_offset < 0) goto bad; + if (tree) { proto_item *ti, *th; proto_tree *sip_tree, *hdr_tree; @@ -104,8 +107,6 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_format_text(tvb, 0, eol)); offset = next_offset; - msg_offset = sip_get_msg_offset(tvb, offset); - if (msg_offset < 0) goto bad; th = proto_tree_add_item(sip_tree, hf_msg_hdr, tvb, offset, msg_offset - offset, FALSE); hdr_tree = proto_item_add_subtree(th, ett_sip_hdr); @@ -119,7 +120,7 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 2; /* Skip the CRLF mentioned above */ } - if (tvb_length_remaining(tvb, offset) > 0) { + if (tvb_length_remaining(tvb, msg_offset) > 0) { next_tvb = tvb_new_subset(tvb, offset, -1, -1); call_dissector(sdp_handle, next_tvb, pinfo, tree); } |