diff options
author | Gerald Combs <gerald@wireshark.org> | 2001-01-30 02:38:33 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2001-01-30 02:38:33 +0000 |
commit | 59dda02da51568c82c9f7ff86d451296a8ee8b05 (patch) | |
tree | fd0205080218a8e68aa75e8fa5ced28de91ad042 /packet-sip.c | |
parent | ad07bc1b53e635e4d4b32560774eed24c358b54d (diff) | |
download | wireshark-59dda02da51568c82c9f7ff86d451296a8ee8b05.tar.gz wireshark-59dda02da51568c82c9f7ff86d451296a8ee8b05.tar.bz2 wireshark-59dda02da51568c82c9f7ff86d451296a8ee8b05.zip |
Slightly better invalid packet handling.
svn path=/trunk/; revision=2959
Diffstat (limited to 'packet-sip.c')
-rw-r--r-- | packet-sip.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-sip.c b/packet-sip.c index 8519f2db19..2e47107ba7 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.12 2001/01/30 02:22:23 gerald Exp $ + * $Id: packet-sip.c,v 1.13 2001/01/30 02:38:33 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -76,7 +76,7 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint32 offset; gint eol, next_offset, msg_offset; tvbuff_t *next_tvb; - gboolean is_request, is_status = FALSE; + gboolean is_request; /* * Note that "tvb_strneql()" doesn't throw exceptions, so @@ -90,14 +90,14 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) eol = tvb_find_line_end(tvb, 0, -1, &next_offset); is_request = sip_is_request(tvb, 0); /* XXX - Is this case-sensitive? RFC 2543 didn't explicitly say. */ - if (tvb_strneql(tvb, 0, SIP2_HDR, SIP2_HDR_LEN) == 0) - is_status = TRUE; + if (tvb_strneql(tvb, 0, SIP2_HDR, SIP2_HDR_LEN) != 0 && ! is_request) + goto bad; - if (check_col(pinfo->fd, COL_PROTOCOL) && (is_request || is_status)) + if (check_col(pinfo->fd, COL_PROTOCOL)) col_set_str(pinfo->fd, COL_PROTOCOL, "SIP"); - if (check_col(pinfo->fd, COL_INFO) && (is_request || is_status)) + if (check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "%s: %s", is_request ? "Request" : "Status", is_request ? |