summaryrefslogtreecommitdiff
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-05-25 20:36:39 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-05-25 20:36:39 -0500
commit7c5529bcd168204669ad83280a28b73e48dc2103 (patch)
tree7dfea1efd41ee1f3cfa1a7aa164a06f3725b5264 /res/res_agi.c
parentd5805abf51bc06b2867a09b97b67f5cc6521b08f (diff)
parent143b758071f6ab5317a54ee83eb56106691f0fea (diff)
Merge "res_agi: Prevent crash when SET VARIABLE called without arguments" into 14
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 a0f48982c..ad6deb150 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;