summaryrefslogtreecommitdiffstats
path: root/crypto/init.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-04-05 10:28:32 +0200
committerRichard Levitte <levitte@openssl.org>2019-04-05 11:32:07 +0200
commite3af453baceee7401ba0c5044a4c3aeaf246406f (patch)
tree3bcb612efea386e43100845cff23a8449412e3cc /crypto/init.c
parentFix number clash: EVP_F_AESNI_XTS_INIT_KEY vs EVP_F_EVP_MD_BLOCK_SIZE (diff)
downloadopenssl-e3af453baceee7401ba0c5044a4c3aeaf246406f.tar.xz
openssl-e3af453baceee7401ba0c5044a4c3aeaf246406f.zip
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 <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8679)
Diffstat (limited to 'crypto/init.c')
-rw-r--r--crypto/init.c2
1 files changed, 1 insertions, 1 deletions
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;
}