]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
check array bounds when parsing arguments to AGI (issue #5868)
authorRussell Bryant <russell@russellbryant.com>
Tue, 20 Dec 2005 20:23:20 +0000 (20:23 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 20 Dec 2005 20:23:20 +0000 (20:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.0@7558 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_agi.c

index 830a11278d4a3c7837be9b3cce4434181287d5bc..8b2dc0c393d345e50153b6cb01fc638bea7d3bfc 100644 (file)
@@ -1649,9 +1649,8 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
        strncpy(buf, data, sizeof(buf) - 1);
 
        memset(&agi, 0, sizeof(agi));
-        while ((stringp = strsep(&tmp, "|"))) {
+        while ((stringp = strsep(&tmp, "|")) && argc < MAX_ARGS - 1)
                argv[argc++] = stringp;
-        }
        argv[argc] = NULL;
 
        LOCAL_USER_ADD(u);