Merged revisions 59037 via svnmerge from
authorOlle Johansson <oej@edvina.net>
Sun, 18 Mar 2007 20:39:37 +0000 (20:39 +0000)
committerOlle Johansson <oej@edvina.net>
Sun, 18 Mar 2007 20:39:37 +0000 (20:39 +0000)
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

channels/chan_sip.c

index 3f45550..bb67890 100644 (file)
@@ -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);