summaryrefslogtreecommitdiff
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-05-25 14:44:11 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-05-25 14:44:11 -0500
commit558199e5ddd7511568429dcddeff8419cb1dc546 (patch)
tree3c326ff9ac9d432ed533bdde497b9977134f1ac7 /res/res_agi.c
parenta3684b74e6ce3c9c67cd93143e9f37177c631b50 (diff)
parentf306e451f6f905a2bb74c15cb844735c244a7610 (diff)
Merge "res_agi: Prevent crash when SET VARIABLE called without arguments" into 13
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 22c480a62..064d87938 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -3208,6 +3208,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]);
@@ -4026,7 +4030,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;