Skip to content
Snippets Groups Projects
Commit 0700951f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Mutex-protect access to cryptfail.

Totally not sketchy, trust me.
parent a94df9ea
No related branches found
No related tags found
No related merge requests found
Pipeline #5391 failed
...@@ -364,6 +364,7 @@ bool do_cryptInit(int (*lprintf)(int level, const char* fmt, ...)) ...@@ -364,6 +364,7 @@ bool do_cryptInit(int (*lprintf)(int level, const char* fmt, ...))
return false; return false;
} }
if (!cryptlib_initialized) { if (!cryptlib_initialized) {
pthread_mutex_lock(&ssl_sess_list_mutex);
if (cryptfail) { if (cryptfail) {
lprintf(LOG_ERR,"cryptInit() returned %d: %s", cryptInit_error, cryptfail); lprintf(LOG_ERR,"cryptInit() returned %d: %s", cryptInit_error, cryptfail);
free(cryptfail); free(cryptfail);
...@@ -371,6 +372,7 @@ bool do_cryptInit(int (*lprintf)(int level, const char* fmt, ...)) ...@@ -371,6 +372,7 @@ bool do_cryptInit(int (*lprintf)(int level, const char* fmt, ...))
} }
else else
lprintf(LOG_ERR,"cryptInit() returned %d", cryptInit_error); lprintf(LOG_ERR,"cryptInit() returned %d", cryptInit_error);
pthread_mutex_unlock(&ssl_sess_list_mutex);
} }
return cryptlib_initialized; return cryptlib_initialized;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment