[asterisk-commits] bweschke: trunk r41930 - /trunk/main/pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Sep 3 14:26:04 MST 2006


Author: bweschke
Date: Sun Sep  3 16:26:04 2006
New Revision: 41930

URL: http://svn.digium.com/view/asterisk?rev=41930&view=rev
Log:
 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.


Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?rev=41930&r1=41929&r2=41930&view=diff
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Sun Sep  3 16:26:04 2006
@@ -5232,8 +5232,10 @@
 
 	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 */



More information about the asterisk-commits mailing list