提交 8fddf6b9 authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Michael Jerris

FS-7513: protect layout hash

上级 9cf804d4
...@@ -800,13 +800,16 @@ static void conference_parse_layouts(conference_obj_t *conference, int WIDTH, in ...@@ -800,13 +800,16 @@ static void conference_parse_layouts(conference_obj_t *conference, int WIDTH, in
switch_xml_t cxml = NULL, cfg = NULL, x_layouts, x_layout, x_layout_settings, x_group, x_groups, x_image; switch_xml_t cxml = NULL, cfg = NULL, x_layouts, x_layout, x_layout_settings, x_group, x_groups, x_image;
char cmd_str[256] = ""; char cmd_str[256] = "";
switch_mutex_lock(globals.setup_mutex);
if (!conference->layout_hash) { if (!conference->layout_hash) {
switch_core_hash_init(&conference->layout_hash); switch_core_hash_init(&conference->layout_hash);
} }
if (!conference->layout_group_hash) { if (!conference->layout_group_hash) {
switch_core_hash_init(&conference->layout_group_hash); switch_core_hash_init(&conference->layout_group_hash);
} }
switch_mutex_unlock(globals.setup_mutex);
switch_event_create(&params, SWITCH_EVENT_COMMAND); switch_event_create(&params, SWITCH_EVENT_COMMAND);
switch_assert(params); switch_assert(params);
...@@ -3171,10 +3174,14 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO ...@@ -3171,10 +3174,14 @@ static void conference_mod_event_channel_handler(const char *event_channel, cJSO
cJSON *array = cJSON_CreateArray(); cJSON *array = cJSON_CreateArray();
conference_obj_t *conference = NULL; conference_obj_t *conference = NULL;
if ((conference = conference_find(conf_name, NULL))) { if ((conference = conference_find(conf_name, NULL))) {
for (hi = switch_core_hash_first(conference->layout_hash); hi; hi = switch_core_hash_next(&hi)) { switch_mutex_lock(globals.setup_mutex);
switch_core_hash_this(hi, &vvar, NULL, &val); if (conference->layout_hash) {
cJSON_AddItemToArray(array, cJSON_CreateString((char *)vvar)); for (hi = switch_core_hash_first(conference->layout_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &val);
cJSON_AddItemToArray(array, cJSON_CreateString((char *)vvar));
}
} }
switch_mutex_unlock(globals.setup_mutex);
switch_thread_rwlock_unlock(conference->rwlock); switch_thread_rwlock_unlock(conference->rwlock);
} }
addobj = array; addobj = array;
...@@ -5318,9 +5325,11 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v ...@@ -5318,9 +5325,11 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
conference->end_time = switch_epoch_time_now(NULL); conference->end_time = switch_epoch_time_now(NULL);
conference_cdr_render(conference); conference_cdr_render(conference);
switch_mutex_lock(globals.setup_mutex);
if (conference->layout_hash) { if (conference->layout_hash) {
switch_core_hash_destroy(&conference->layout_hash); switch_core_hash_destroy(&conference->layout_hash);
} }
switch_mutex_unlock(globals.setup_mutex);
if (conference->layout_group_hash) { if (conference->layout_group_hash) {
switch_core_hash_destroy(&conference->layout_group_hash); switch_core_hash_destroy(&conference->layout_group_hash);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论