diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-04-20 15:45:06 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-04-20 15:45:06 +0200 |
commit | eb2b9892065cf5b69400b98ca82e4e99a525eb29 (patch) | |
tree | 0185f809739e7ffbde0ee7d477f749fd34a541ce /crypto/ex_data.c | |
parent | openssl/err.h: remove duplicate OSSL_STOREerr() (diff) | |
download | openssl-eb2b9892065cf5b69400b98ca82e4e99a525eb29.tar.xz openssl-eb2b9892065cf5b69400b98ca82e4e99a525eb29.zip |
Ensure the thread keys are always allocated in the same order
Fixes: #5899
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5911)
Diffstat (limited to 'crypto/ex_data.c')
-rw-r--r-- | crypto/ex_data.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ex_data.c b/crypto/ex_data.c index ed9820cfad..08dc7c4073 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -37,7 +37,8 @@ static CRYPTO_ONCE ex_data_init = CRYPTO_ONCE_STATIC_INIT; DEFINE_RUN_ONCE_STATIC(do_ex_data_init) { - OPENSSL_init_crypto(0, NULL); + if (!OPENSSL_init_crypto(0, NULL)) + return 0; ex_data_lock = CRYPTO_THREAD_lock_new(); return ex_data_lock != NULL; } |