From f9cfe3689b947dc85e445057bd8d2f3f427e14fa Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 20 Dec 2005 20:21:26 +0000 Subject: check array bounds when parsing arguments to AGI (issue #5868) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7557 f38db490-d61c-443f-a65b-d21fe96a405b --- res/res_agi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'res') diff --git a/res/res_agi.c b/res/res_agi.c index 9ec6f5cb6..155722e80 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -2016,9 +2016,8 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int ast_copy_string(buf, data, sizeof(buf)); 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); -- cgit v1.2.3