aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-23 03:07:48 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-23 03:07:48 +0000
commitc75d2ac2c08a47c7be29d470a96ed583015b3884 (patch)
treea2d765ef025522354203d8baa9dad7db65eec3f0 /res/res_agi.c
parent27288e607246d63e8456a57b6e6ef7553209ac1a (diff)
Merged revisions 236184 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r236184 | tilghman | 2009-12-22 20:55:24 -0600 (Tue, 22 Dec 2009) | 4 lines If EXEC only gets a single argument, don't crash when the second is used. (closes issue #16504) Reported by: bklang ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236186 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 0a468f443..fad66ce64 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -2295,7 +2295,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, const char
if (ast_compat_res_agi && !ast_strlen_zero(argv[2])) {
char *compat = alloca(strlen(argv[2]) * 2 + 1), *cptr;
const char *vptr;
- for (cptr = compat, vptr = argv[2]; *vptr; vptr++) {
+ for (cptr = compat, vptr = (argc == 2) ? "" : argv[2]; *vptr; vptr++) {
if (*vptr == ',') {
*cptr++ = '\\';
*cptr++ = ',';
@@ -2308,7 +2308,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, const char
*cptr = '\0';
res = pbx_exec(chan, app_to_exec, compat);
} else {
- res = pbx_exec(chan, app_to_exec, argv[2]);
+ res = pbx_exec(chan, app_to_exec, argc == 2 ? "" : argv[2]);
}
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);