Access data after obtaining the lock not before.
It isn't completely clear that this constitutes a race condition, but it will always be conservative to access the locked data after getting the lock. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9579)
This commit is contained in:
parent
d954227611
commit
aee6e29f0e
1 changed files with 1 additions and 1 deletions
|
@ -49,8 +49,8 @@ static EX_CALLBACKS *get_and_lock(OPENSSL_CTX *ctx, int class_index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ip = &global->ex_data[class_index];
|
||||
CRYPTO_THREAD_write_lock(global->ex_data_lock);
|
||||
ip = &global->ex_data[class_index];
|
||||
return ip;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue