[asterisk-commits] kmoore: trunk r323106 - /trunk/apps/app_confbridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 13 09:30:56 CDT 2011


Author: kmoore
Date: Mon Jun 13 09:30:51 2011
New Revision: 323106

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=323106
Log:
ConfBridge: Use of bridge or user profiles that don't exist

Bridge and user profiles are not checked for existence before use.  The lack
of a fully formed bridge profile can cause a segfault when sounds are accessed.
This change ensures that bridge and user profiles exist prior to usage
attempts.

Review: https://reviewboard.asterisk.org/r/1264/

Modified:
    trunk/apps/app_confbridge.c

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=323106&r1=323105&r2=323106
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Mon Jun 13 09:30:51 2011
@@ -1192,14 +1192,22 @@
 	if (args.argc > 1 && !ast_strlen_zero(args.b_profile_name)) {
 		b_profile_name = args.b_profile_name;
 	}
-	conf_find_bridge_profile(chan, b_profile_name, &conference_bridge_user.b_profile);
+	if (!conf_find_bridge_profile(chan, b_profile_name, &conference_bridge_user.b_profile)) {
+		ast_log(LOG_WARNING, "Conference bridge profile %s does not exist\n", b_profile_name);
+		res = -1;
+		goto confbridge_cleanup;
+	}
 
 	/* user profile name */
 	if (args.argc > 2 && !ast_strlen_zero(args.u_profile_name)) {
 		u_profile_name = args.u_profile_name;
 	}
 
-	conf_find_user_profile(chan, u_profile_name, &conference_bridge_user.u_profile);
+	if (!conf_find_user_profile(chan, u_profile_name, &conference_bridge_user.u_profile)) {
+		ast_log(LOG_WARNING, "Conference user profile %s does not exist\n", u_profile_name);
+		res = -1;
+		goto confbridge_cleanup;
+	}
 	quiet = ast_test_flag(&conference_bridge_user.u_profile, USER_OPT_QUIET);
 
 	/* ask for a PIN immediately after finding user profile.  This has to be




More information about the asterisk-commits mailing list