summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-03-18 20:39:37 +0000
committerOlle Johansson <oej@edvina.net>2007-03-18 20:39:37 +0000
commitdddb57b242ac12f9549de1f39631ca06ac9bec9d (patch)
tree427c2fa9fb347c56ef091c85a2761feecaa3fc4c /channels
parent39857b78e713ed0818f8ad2baa687638e441eaff (diff)
Merged revisions 59037 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r59037 | oej | 2007-03-18 21:37:06 +0100 (Sun, 18 Mar 2007) | 3 lines Issue #9313, Asterisk crash on SIP return code 0 (reported by qwerty1979) (ASA-2007-011) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-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 3f4555054..bb67890a0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -15295,6 +15295,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);