]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If EXEC only gets a single argument, don't crash when the second is used.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 23 Dec 2009 02:55:24 +0000 (02:55 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 23 Dec 2009 02:55:24 +0000 (02:55 +0000)
(closes issue #16504)
 Reported by: bklang

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@236184 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_agi.c

index 665ccb1f5ceb5c88016227f26f8cec2c0de84b7d..f0da5e2fc493659498d7fa3494a02e5aea1ec47d 100644 (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;