]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 297959 via svnmerge from
authorTerry Wilson <twilson@digium.com>
Thu, 9 Dec 2010 22:10:31 +0000 (22:10 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 9 Dec 2010 22:10:31 +0000 (22:10 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r297959 | twilson | 2010-12-09 16:00:30 -0600 (Thu, 09 Dec 2010) | 14 lines

  Ignore spurious REGISTER requests

  If a REGISTER request with a Call-ID matching an existing transaction is received
  it was possible that the REGISTER request would overwrite the initreq of the
  private structure. This info is used to generate messages for other responses in
  the transaction. This patch ignores REGISTER requests that match non-REGISTER
  transactions.

  (closes issue #18051)
  Reported by: eeman
  Tested by: twilson

  Review: https://reviewboard.asterisk.org/r/1050/
........

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

channels/chan_sip.c

index b4068dd84959caf79a1350564746c57c33e518e2..80e8b754469887cd67f29855062f76b743a67300 100644 (file)
@@ -21775,6 +21775,13 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, s
 {
        enum check_auth_result res;
 
+       /* If this is not the intial request, and the initial request isn't
+        * a register, something screwy happened, so bail */
+       if (p->initreq.headers && p->initreq.method != SIP_REGISTER) {
+               ast_log(LOG_WARNING, "Ignoring spurious REGISTER with Call-ID: %s\n", p->callid);
+               return -1;
+       }
+
        /* Use this as the basis */
        copy_request(&p->initreq, req);
        if (sipdebug)