forked from osmocom/wireshark
From Steven Lass: if there is no whitespace after the colon in a header,
don't try to eat the non-existent whitespace. svn path=/trunk/; revision=7763
This commit is contained in:
parent
e43ca5a763
commit
eb9ef15711
1
AUTHORS
1
AUTHORS
|
@ -1723,6 +1723,7 @@ And assorted fixes and enhancements by the people listed above and by:
|
|||
David Yon <yon [AT] tacticalsoftware.com>
|
||||
Marcio Franco <franco.marcio [AT] rd.francetelecom.fr>
|
||||
Kaloian Stoilov <kalkata [AT] yahoo.com>
|
||||
Steven Lass <stevenlass [AT] mail.com>
|
||||
|
||||
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
|
||||
give his permission to use his version of snprintf.c.
|
||||
|
|
|
@ -1781,6 +1781,7 @@ B<http://www.ethereal.com>.
|
|||
David Yon <yon [AT] tacticalsoftware.com>
|
||||
Marcio Franco <franco.marcio [AT] rd.francetelecom.fr>
|
||||
Kaloian Stoilov <kalkata [AT] yahoo.com>
|
||||
Steven Lass <stevenlass [AT] mail.com>
|
||||
|
||||
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
|
||||
permission to use his version of snprintf.c.
|
||||
|
|
33
packet-sip.c
33
packet-sip.c
|
@ -17,7 +17,7 @@
|
|||
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
|
||||
* Copyright 2001, Jean-Francois Mule <jfm@cablelabs.com>
|
||||
*
|
||||
* $Id: packet-sip.c,v 1.35 2003/03/11 01:48:55 gerald Exp $
|
||||
* $Id: packet-sip.c,v 1.36 2003/05/29 18:29:36 guy Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@ethereal.com>
|
||||
|
@ -326,12 +326,31 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
hf_index = sip_is_known_sip_header(tvb, offset, &header_len);
|
||||
|
||||
if (hf_index == -1) {
|
||||
proto_tree_add_text(hdr_tree, tvb, offset , next_offset - offset, "%s",
|
||||
tvb_format_text(tvb, offset, eol));
|
||||
}
|
||||
else {
|
||||
proto_tree_add_string(hdr_tree, hf_header_array[hf_index], tvb, offset, next_offset - offset ,
|
||||
tvb_format_text(tvb, offset + header_len + 2, eol - header_len - 2));
|
||||
proto_tree_add_text(hdr_tree, tvb, offset,
|
||||
next_offset - offset, "%s",
|
||||
tvb_format_text(tvb, offset, eol));
|
||||
} else {
|
||||
/*
|
||||
* XXX - shouldn't use "tvb_format_text()"
|
||||
* here; we should add the string *as is*
|
||||
* to the protocol tree.
|
||||
*/
|
||||
if (tvb_find_guint8(tvb,
|
||||
offset + header_len + 1, 1, ' ') == -1) {
|
||||
proto_tree_add_string(hdr_tree,
|
||||
hf_header_array[hf_index], tvb,
|
||||
offset, next_offset - offset,
|
||||
tvb_format_text(tvb,
|
||||
offset + header_len + 1,
|
||||
eol - header_len - 1));
|
||||
} else { /* eat leading whitespace */
|
||||
proto_tree_add_string(hdr_tree,
|
||||
hf_header_array[hf_index], tvb,
|
||||
offset, next_offset - offset,
|
||||
tvb_format_text(tvb,
|
||||
offset + header_len + 2,
|
||||
eol - header_len - 2));
|
||||
}
|
||||
}
|
||||
|
||||
offset = next_offset;
|
||||
|
|
Loading…
Reference in New Issue