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
parent0f5163bd1c9d993ec54b690b9da8d13efe089be0 (diff)
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;
}