]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add another sanity check in the AGI read loop. We really don't care about
authorRussell Bryant <russell@russellbryant.com>
Mon, 1 Oct 2007 19:56:28 +0000 (19:56 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 1 Oct 2007 19:56:28 +0000 (19:56 +0000)
EAGAIN unless we didn't read an entire line.  If there is a newline at the
end if the read buffer, break, because we got the whole thing.
(reported and patched by bmd)

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

res/res_agi.c

index 376089eff0b389e2d03f7f30fec4cf5c8713a04f..5ea2d69a0c221c73009d018daed73209bb233183 100644 (file)
@@ -1884,6 +1884,8 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi
                                if (res != NULL && !agi->fast)
                                        break;
                                buflen = strlen(buf);
+                               if (buflen && buf[buflen - 1] == '\n')
+                                       break;
                                len -= buflen;
                                if (agidebug)
                                        ast_verbose( "AGI Rx << temp buffer %s - errno %s\n", buf, strerror(errno));