From aee6e29f0e88df18ebc21dbcf9d4d5794d7511e0 Mon Sep 17 00:00:00 2001 From: Pauli Date: Mon, 12 Aug 2019 20:07:39 +1000 Subject: [PATCH] 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 Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9579) --- crypto/ex_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/ex_data.c b/crypto/ex_data.c index a49aa087c8..cd8e695855 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -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; } -- 2.39.2