Merge "res_agi: Prevent crash when SET VARIABLE called without arguments" into 13

This commit is contained in:
Jenkins2
2017-05-25 14:44:11 -05:00
committed by Gerrit Code Review

View File

@@ -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;