check array bounds when parsing arguments to AGI (issue #5868)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Russell Bryant 20 years ago
parent 3bbeaefa57
commit 71d9531e45

@ -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);

Loading…
Cancel
Save