summaryrefslogtreecommitdiffstats
path: root/crypto/ex_data.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-08-12 20:07:39 +1000
committerPauli <paul.dale@oracle.com>2019-08-12 21:37:55 +1000
commitaee6e29f0e88df18ebc21dbcf9d4d5794d7511e0 (patch)
tree75a5b9c67884d6418e360e1c94b49f2c9a7deaa5 /crypto/ex_data.c
parentd95422761116791966dcd0dd7035b46795482482 (diff)
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)
Diffstat (limited to 'crypto/ex_data.c')
-rw-r--r--crypto/ex_data.c2
1 files changed, 1 insertions, 1 deletions
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;
}