aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-18 20:37:06 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-18 20:37:06 +0000
commit55784a2414110c994e5cccd138566b03868ca8c3 (patch)
treee6c294d29e7d1867d615672d13f417dbb11523f7
parent0ee369b75eacb5c8081051f4bf9b57f2906ca2e9 (diff)
Issue #9313, Asterisk crash on SIP return code 0 (reported by qwerty1979) (ASA-2007-011)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59037 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3e11aee05..e925e5dbc 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14612,6 +14612,10 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
if (sscanf(e, "%d %n", &respid, &len) != 1) {
ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
} else {
+ if (respid <= 0) {
+ ast_log(LOG_WARNING, "Invalid SIP response code: '%d'\n", respid);
+ return 0;
+ }
/* More SIP ridiculousness, we have to ignore bogus contacts in 100 etc responses */
if ((respid == 200) || ((respid >= 300) && (respid <= 399)))
extract_uri(p, req);