diff --git a/res/res_agi.c b/res/res_agi.c index 9ec6f5cb6c..155722e803 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);