aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-03 21:26:04 +0000
committerbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-03 21:26:04 +0000
commit2dfdcd3b538e2aef94be73245ba1504de32e103c (patch)
treebb2493b94a19eedb26916b40560eec04c353d9ea /main
parentfde2dce41eb97bf1a379da93b06cf17d40aa7891 (diff)
Provide a little more protection to make sure that a MOH class is specified when using the 'm' option with WaitExten, and prevent a segfault in the process.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41930 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c
index c98b57173..e875c8810 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -5232,8 +5232,10 @@ static int pbx_builtin_waitexten(struct ast_channel *chan, void *data)
if (args.options)
ast_app_parse_options(waitexten_opts, &flags, opts, args.options);
-
- if (ast_test_flag(&flags, WAITEXTEN_MOH))
+
+ if (ast_test_flag(&flags, WAITEXTEN_MOH) && !opts[0] ) {
+ ast_log(LOG_WARNING, "The 'm' option has been specified for WaitExten without a class.\n");
+ } else if (ast_test_flag(&flags, WAITEXTEN_MOH))
ast_indicate_data(chan, AST_CONTROL_HOLD, opts[0], strlen(opts[0]));
/* Wait for "n" seconds */