diff options
author | Moshe Kaplan <me@moshekaplan.com> | 2022-06-29 11:21:25 -0400 |
---|---|---|
committer | Moshe Kaplan <me@moshekaplan.com> | 2022-06-29 11:21:25 -0400 |
commit | 1b586a66dfa8277cf94c0f0b8237fe600c76b0e0 (patch) | |
tree | fa67fe6bf27d7e8512176c687dc88505fc0d55bb /epan/register.c | |
parent | ac4b9e174de5d8694e79dec36d9234c55014e9fd (diff) |
register.c: Avoid potential race condition (Coverity 1477510)
Wrap writing to cur_cb_name in a mutex, to avoid
potential race conditions.
Fixes Coverity 1477510.
Diffstat (limited to 'epan/register.c')
-rw-r--r-- | epan/register.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/register.c b/epan/register.c index cd6bf735c7..d8c0eda839 100644 --- a/epan/register.c +++ b/epan/register.c @@ -119,12 +119,12 @@ register_all_protocol_handoffs_worker(void *arg _U_) void register_all_protocol_handoffs(register_cb cb, gpointer cb_data) { - cur_cb_name = NULL; const char *cb_name; gboolean called_back = FALSE; GThread *raphw_thread; const char *error_message; + set_cb_name(NULL); raphw_thread = g_thread_new("register_all_protocol_handoffs_worker", ®ister_all_protocol_handoffs_worker, NULL); while (!g_async_queue_timeout_pop(register_cb_done_q, CB_WAIT_TIME)) { g_mutex_lock(&cur_cb_name_mtx); |