From: Richard Levitte Date: Fri, 5 Apr 2019 08:28:32 +0000 (+0200) Subject: OPENSSL_init_crypto(): check config return code correctly X-Git-Tag: openssl-3.0.0-alpha1~2223 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e3af453baceee7401ba0c5044a4c3aeaf246406f;p=oweals%2Fopenssl.git 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) --- diff --git a/crypto/init.c b/crypto/init.c index 463da9853d..43fe1a6e1b 100644 --- a/crypto/init.c +++ b/crypto/init.c @@ -670,7 +670,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; }