]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 59194 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Sat, 24 Mar 2007 01:39:44 +0000 (01:39 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 24 Mar 2007 01:39:44 +0000 (01:39 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59194 | file | 2007-03-23 21:35:49 -0400 (Fri, 23 Mar 2007) | 2 lines

Only try to handle a response if it has a response code. (ASA-2007-011)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59195 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 55b911ac3b492ff84ac3db5744e01b2bb479fbf1..6b14d052d637aef615c788c11cf9c335fb9efcd2 100644 (file)
@@ -14609,20 +14609,20 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
                        ast_set_flag(req, SIP_PKT_IGNORE);
                        ast_set_flag(req, SIP_PKT_IGNORE_RESP);
                        append_history(p, "Ignore", "Ignoring this retransmit\n");
-               }
-       
-               e = ast_skip_blanks(e);
-               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;
+               } 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 {
+                               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);
+                               handle_response(p, respid, e + len, req, ignore, seqno);
                        }
-                       /* 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;
        }