From: Tilghman Lesher Date: Wed, 23 Dec 2009 02:55:24 +0000 (+0000) Subject: If EXEC only gets a single argument, don't crash when the second is used. X-Git-Tag: 1.4.29-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b317f3ce7fb3f3324d3871ad8d45c787f9ca2704;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_agi.c b/res/res_agi.c index 665ccb1f5c..f0da5e2fc4 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -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;