mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Some sanity checking for MixMonitor. If only 1 argument is given, then the args.options
and args.post_process strings are uninitialized and could contain garbage. This change handles this situation properly by only using arguments that we have parsed. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -332,7 +332,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.options) {
|
if (args.argc > 1 && args.options) {
|
||||||
char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
|
char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
|
||||||
|
|
||||||
ast_app_parse_options(mixmonitor_opts, &flags, opts, args.options);
|
ast_app_parse_options(mixmonitor_opts, &flags, opts, args.options);
|
||||||
@@ -378,7 +378,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
|
pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
|
||||||
launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);
|
launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.argc > 2 ? args.post_process : "");
|
||||||
|
|
||||||
ast_module_user_remove(u);
|
ast_module_user_remove(u);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user