From b7534359306754b90a4f18aa5231477510488713 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 5 Apr 2019 10:28:32 +0200 Subject: [PATCH] OPENSSL_init_crypto(): check config return code correctly It was assumed that the config functionality returned a boolean. However, it may return a negative number on error, so we need to take that into account. Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/8679) (cherry picked from commit e3af453baceee7401ba0c5044a4c3aeaf246406f) --- crypto/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/init.c b/crypto/init.c index dc6ec396dd..afb213315e 100644 --- a/crypto/init.c +++ b/crypto/init.c @@ -702,7 +702,7 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) ret = RUN_ONCE(&config, ossl_init_config); conf_settings = NULL; CRYPTO_THREAD_unlock(init_lock); - if (!ret) + if (ret <= 0) return 0; } -- 2.25.1