diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-24 01:35:49 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-24 01:35:49 +0000 |
commit | 759622c84fa374fc6ad9e41d6ceb9c0afd41ac4e (patch) | |
tree | 53f025cc0812d7abdc3b698d2c783b65bfcefa4e /channels/chan_sip.c | |
parent | 5bff9247b48fc8619cf4f3f7aaa61f303eecb61f (diff) |
Only try to handle a response if it has a response code. (ASA-2007-011)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@59194 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8946bab58..c79e7ab65 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; } |