diff options
author | George Joseph <gjoseph@digium.com> | 2017-05-26 07:12:16 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-05-26 07:12:16 -0500 |
commit | 6bb3cedb1ba1e2c3aed977f2af6a345c45c8865e (patch) | |
tree | cb773e5ba460ba6cacb4b65d59e41203a097adb4 | |
parent | 366b10a5007b1e4b3ec8dcf569b9b07f92c4770e (diff) | |
parent | 3dcb3c88aa2f77d32fb4a0c6370b337bb017f30e (diff) |
Merge "res_agi: Prevent crash when SET VARIABLE called without arguments"
-rw-r--r-- | res/res_agi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 3af4cdb4f..f5dee00d9 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -3206,6 +3206,10 @@ static int handle_channelstatus(struct ast_channel *chan, AGI *agi, int argc, co static int handle_setvariable(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[]) { + if (argc != 4) { + return RESULT_SHOWUSAGE; + } + if (argv[3]) pbx_builtin_setvar_helper(chan, argv[2], argv[3]); @@ -4024,7 +4028,7 @@ static void publish_async_exec_end(struct ast_channel *chan, int command_id, con static enum agi_result agi_handle_command(struct ast_channel *chan, AGI *agi, char *buf, int dead) { - const char *argv[MAX_ARGS]; + const char *argv[MAX_ARGS] = {0}; int argc = MAX_ARGS; int res; agi_command *c; |