From 2f304d877c7e0613d6fd952d7feacbf40dbc355c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20M=C3=A4nnchen?= Date: Wed, 3 Apr 2024 16:47:54 +0200 Subject: [PATCH] Merge pull request from GHSA-mj35-2rgf-cv8p --- src/oidcc_provider_configuration_worker.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/oidcc_provider_configuration_worker.erl b/src/oidcc_provider_configuration_worker.erl index 13294e2..922b632 100644 --- a/src/oidcc_provider_configuration_worker.erl +++ b/src/oidcc_provider_configuration_worker.erl @@ -352,16 +352,15 @@ lookup_in_ets_or_call(Name, Key, Call) -> -spec get_ets_table_name(WorkerRef :: gen_server:server_ref()) -> {ok, gen_server:server_ref()} | error. -get_ets_table_name(WorkerName) when is_atom(WorkerName) -> - {ok, erlang:list_to_atom(erlang:atom_to_list(WorkerName) ++ "_table")}; +get_ets_table_name(Name) when is_atom(Name) -> + {ok, Name}; get_ets_table_name(_Ref) -> error. -spec register_ets_table(Opts :: opts()) -> ets:table() | undefined. register_ets_table(Opts) -> case maps:get(name, Opts, undefined) of - {local, WorkerName} -> - Name = erlang:list_to_atom(erlang:atom_to_list(WorkerName) ++ "_table"), + {local, Name} -> ets:new(Name, [named_table, bag, protected, {read_concurrency, true}]); _OtherName -> undefined