forked from osmocom/wireshark
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.
This commit is contained in:
parent
ac4b9e174d
commit
1b586a66df
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue