From eb2b9892065cf5b69400b98ca82e4e99a525eb29 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 20 Apr 2018 15:45:06 +0200 Subject: Ensure the thread keys are always allocated in the same order Fixes: #5899 Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/5911) --- crypto/engine/eng_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crypto/engine') diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c index f5031d3eb7..95736eda6a 100644 --- a/crypto/engine/eng_lib.c +++ b/crypto/engine/eng_lib.c @@ -20,7 +20,8 @@ CRYPTO_ONCE engine_lock_init = CRYPTO_ONCE_STATIC_INIT; DEFINE_RUN_ONCE(do_engine_lock_init) { - OPENSSL_init_crypto(0, NULL); + if (!OPENSSL_init_crypto(0, NULL)) + return 0; global_engine_lock = CRYPTO_THREAD_lock_new(); return global_engine_lock != NULL; } -- cgit v1.2.1