If EXEC only gets a single argument, don't crash when the second is used.

(closes issue #16504)
 Reported by: bklang


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@236184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2009-12-23 02:55:24 +00:00
parent af1319f400
commit b317f3ce7f
+1 -1
View File
@@ -1140,7 +1140,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
if(!strcasecmp(argv[1], PARK_APP_NAME)) {
ast_masq_park_call(chan, NULL, 0, NULL);
}
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]);
res = -2;