diff options
author | Kinsey Moore <kmoore@digium.com> | 2011-06-13 14:30:51 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2011-06-13 14:30:51 +0000 |
commit | cd1547792352db5f8ed9ad350d44ed8b4b3cb46b (patch) | |
tree | 0343357121c30baebbc32a0a380085454126f5e6 /apps/app_confbridge.c | |
parent | 4c459c2c85570be995e2f2c5f38c7d7ec427008f (diff) |
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/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_confbridge.c')
-rw-r--r-- | apps/app_confbridge.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index 7cede133e..7c4a0587a 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -1192,14 +1192,22 @@ static int confbridge_exec(struct ast_channel *chan, const char *data) 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 |