aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-23 03:10:10 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-23 03:10:10 +0000
commitd3a06ee8328cd547775858805ce5a955d1714ca3 (patch)
treeda2eb95449e8a2358614ce15fa4b25c0fa7f74f0
parent88f18ec112be8bb798b17a9a4e6222b7f546ee2f (diff)
Merged revisions 236186 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r236186 | tilghman | 2009-12-22 21:07:48 -0600 (Tue, 22 Dec 2009) | 11 lines 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/branches/1.6.0@236187 f38db490-d61c-443f-a65b-d21fe96a405b
-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 4530e31b6..b02af1797 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -1496,7 +1496,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
if ((app = pbx_findapp(argv[1]))) {
if (ast_compat_res_agi && !ast_strlen_zero(argv[2])) {
char *compat = alloca(strlen(argv[2]) * 2 + 1), *cptr, *vptr;
- for (cptr = compat, vptr = argv[2]; *vptr; vptr++) {
+ for (cptr = compat, vptr = (argc == 2) ? "" : argv[2]; *vptr; vptr++) {
if (*vptr == ',') {
*cptr++ = '\\';
*cptr++ = ',';
@@ -1509,7 +1509,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
*cptr = '\0';
res = pbx_exec(chan, app, compat);
} else {
- res = pbx_exec(chan, app, argv[2]);
+ res = pbx_exec(chan, app, argc == 2 ? "" : argv[2]);
}
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);