diff options
author | Anders Broman <anders.broman@ericsson.com> | 2004-04-03 22:33:45 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2004-04-03 22:33:45 +0000 |
commit | 061bb9ee8f12811fcb4e12d4ba98637d7c359392 (patch) | |
tree | 348a7fe79839a2021ff12725fdb05895dae37040 /packet-sip.c | |
parent | 37f056b42bdbdfb30f35b709acea9d63c90fe38d (diff) | |
download | wireshark-061bb9ee8f12811fcb4e12d4ba98637d7c359392.tar.gz wireshark-061bb9ee8f12811fcb4e12d4ba98637d7c359392.tar.bz2 wireshark-061bb9ee8f12811fcb4e12d4ba98637d7c359392.zip |
As pointed out by Chernishov Yury - strip of leading spaces of parameters
svn path=/trunk/; revision=10550
Diffstat (limited to 'packet-sip.c')
-rw-r--r-- | packet-sip.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/packet-sip.c b/packet-sip.c index 7f12cbe7ab..d397181381 100644 --- a/packet-sip.c +++ b/packet-sip.c @@ -18,7 +18,7 @@ * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi> * Copyright 2001, Jean-Francois Mule <jfm@cablelabs.com> * - * $Id: packet-sip.c,v 1.62 2004/03/30 18:55:46 guy Exp $ + * $Id: packet-sip.c,v 1.63 2004/04/03 22:33:45 etxrab Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -535,7 +535,7 @@ dissect_sip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, while (tvb_reported_length_remaining(tvb, offset) > 0) { gint line_end_offset; gint colon_offset; - gint semicolon_offset; + gint parameter_offset; gint content_type_len, content_type_parameter_str_len; gint header_len; gint hf_index; @@ -744,11 +744,19 @@ dissect_sip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvb_format_text(tvb, offset, linelen)); } content_type_len = value_len; - semicolon_offset = tvb_find_guint8(tvb, value_offset,linelen, ';'); - if ( semicolon_offset != -1) { - content_type_len = semicolon_offset - value_offset; - content_type_parameter_str_len = line_end_offset - (semicolon_offset + 1); - content_type_parameter_str = tvb_get_string(tvb, semicolon_offset + 1, + parameter_offset = tvb_find_guint8(tvb, value_offset,linelen, ';'); + if ( parameter_offset != -1) { + /* + * Skip whitespace after the semicolon. + */ + while (parameter_offset < line_end_offset + && ((c = tvb_get_guint8(tvb, + value_offset)) == ' ' + || c == '\t')) + parameter_offset++; + content_type_len = parameter_offset - value_offset; + content_type_parameter_str_len = line_end_offset - (parameter_offset + 1); + content_type_parameter_str = tvb_get_string(tvb, parameter_offset + 1, content_type_parameter_str_len); } media_type_str = tvb_get_string(tvb, value_offset, content_type_len); |