]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Only try to handle a response if it has a response code. (ASA-2007-011)
authorJoshua Colp <jcolp@digium.com>
Sat, 24 Mar 2007 01:35:49 +0000 (01:35 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 24 Mar 2007 01:35:49 +0000 (01:35 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@59194 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 8946bab589cd3eb6200665ea1b856e0d18c9ceb6..c79e7ab65daf891c3faceec40c838525bcaf0b03 100644 (file)
@@ -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;
        }