aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-20 20:21:26 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-20 20:21:26 +0000
commitf9cfe3689b947dc85e445057bd8d2f3f427e14fa (patch)
treea9a2774ae20f7af3e9540dfe8d4be4336844e44d /res
parent072a43d4774a28da8946073f6b5fbfff4c84043b (diff)
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
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c3
1 files changed, 1 insertions, 2 deletions
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);