From: Mark Spencer Date: Sat, 22 May 2004 04:52:50 +0000 (+0000) Subject: Work on a copy with app_agi X-Git-Tag: 1.0.0-rc1~411 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47133fda31483f9365648758f09e1c647c4a2979;p=thirdparty%2Fasterisk.git Work on a copy with app_agi git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3039 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_agi.c b/apps/app_agi.c index d7af708b4d..ef84363255 100755 --- a/apps/app_agi.c +++ b/apps/app_agi.c @@ -1466,7 +1466,8 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int int res=0; struct localuser *u; char *argv[MAX_ARGS]; - char *tmp = (char *)data; + char buf[2048]=""; + char *tmp = (char *)buf; int argc = 0; int fds[2]; int efd = -1; @@ -1477,7 +1478,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int ast_log(LOG_WARNING, "AGI requires an argument (script)\n"); return -1; } - + strncpy(buf, data, sizeof(buf) - 1); memset(&agi, 0, sizeof(agi)); while ((stringp = strsep(&tmp, "|"))) { @@ -1500,7 +1501,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int agi.fd = fds[1]; agi.ctrl = fds[0]; agi.audio = efd; - res = run_agi(chan, tmp, &agi, pid, dead); + res = run_agi(chan, argv[0], &agi, pid, dead); close(fds[1]); if (efd > -1) close(efd);