From: Joshua Colp Date: Sat, 24 Mar 2007 01:35:49 +0000 (+0000) Subject: Only try to handle a response if it has a response code. (ASA-2007-011) X-Git-Tag: 1.2.18~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9593ae4269ab58ee57ebcaa9373eb8851f15186e;p=thirdparty%2Fasterisk.git Only try to handle a response if it has a response code. (ASA-2007-011) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@59194 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8946bab589..c79e7ab65d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11295,16 +11295,16 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc /* ignore means "don't do anything with it" but still have to respond appropriately */ ignore=1; - } - - e = ast_skip_blanks(e); - if (sscanf(e, "%d %n", &respid, &len) != 1) { - ast_log(LOG_WARNING, "Invalid response: '%s'\n", e); - } else { - /* More SIP ridiculousness, we have to ignore bogus contacts in 100 etc responses */ - if ((respid == 200) || ((respid >= 300) && (respid <= 399))) - extract_uri(p, req); - handle_response(p, respid, e + len, req, ignore, seqno); + } else if (e) { + e = ast_skip_blanks(e); + if (sscanf(e, "%d %n", &respid, &len) != 1) { + ast_log(LOG_WARNING, "Invalid response: '%s'\n", e); + } else { + /* More SIP ridiculousness, we have to ignore bogus contacts in 100 etc responses */ + if ((respid == 200) || ((respid >= 300) && (respid <= 399))) + extract_uri(p, req); + handle_response(p, respid, e + len, req, ignore, seqno); + } } return 0; }