Fix accidental strlen_zero mistransfer (bug #1592)
authorMark Spencer <markster@digium.com>
Sun, 9 May 2004 20:46:18 +0000 (20:46 +0000)
committerMark Spencer <markster@digium.com>
Sun, 9 May 2004 20:46:18 +0000 (20:46 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2936 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 5646db5..4841da7 100755 (executable)
@@ -5020,11 +5020,11 @@ static void receive_info(struct sip_pvt *p, struct sip_request *req)
 
                /* Try getting the "signal=" part */
                if (ast_strlen_zero(c = get_sdp(req, "Signal")) && ast_strlen_zero(c = get_sdp(req, "d"))) {
-                  strncpy(buf, c, sizeof(buf) - 1);
-               } else {
                   ast_log(LOG_WARNING, "Unable to retrieve DTMF signal from INFO message from %s\n", p->callid);
                   transmit_response(p, "200 OK", req); /* Should return error */
                   return;
+               } else {
+                  strncpy(buf, c, sizeof(buf) - 1);
                }
        
                if (p->owner) { /* PBX call */