aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-13 00:56:46 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-13 00:56:46 +0000
commit9920cdd91fb0e944cf58b9c94d6bac9f8dd551af (patch)
tree49962c7a183cd407cc4dec19358a563ac09106f2
parenta786fdf6f401f06bfb86c8662dd95849c1026285 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@89205 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_mixmonitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c
index ec9c2e2a3..7d3279398 100644
--- a/apps/app_mixmonitor.c
+++ b/apps/app_mixmonitor.c
@@ -332,7 +332,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
return -1;
}
- if (args.options) {
+ if (args.argc > 1 && args.options) {
char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
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);
- 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);