aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/init.c
diff options
context:
space:
mode:
authorMat <mberchtold@gmail.com>2016-10-03 05:40:32 +0200
committerRich Salz <rsalz@openssl.org>2016-10-19 06:59:03 -0400
commita1f2b0e6e07a53c0ae2c81cba319b90e54210cd6 (patch)
tree365def8d907ec622ab5dab66ad515cd9dbc21ee4 /crypto/init.c
parent31dad404fd6854ec8dd697bcccfef1e8dba3faff (diff)
downloadopenssl-a1f2b0e6e07a53c0ae2c81cba319b90e54210cd6.tar.gz
Do not set load_crypto_strings_inited when OPENSSL_NO_ERR is defined
Only set the load_crypto_strings_inited to 1 when err_load_crypto_strings_int was called. This solves the following issue: - openssl is built with no-err - load_crypto_strings_inited is set to 1 during the OPENSSL_init_crypto call - During the cleanup: OPENSSL_cleanup, err_free_strings_int is called because load_crypto_strings_inited == 1 - err_free_strings_int calls do_err_strings_init because it has never been called - Now do_err_strings_init calls OPENSSL_init_crypto - But since we are in the cleanup (stopped == 1) this results in an error: CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL); - which then tries to initialize everything we are trying to clean up: ERR_get_state, ossl_init_thread_start, etc Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1654)
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 9af857b3f6..7423eccb1b 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -103,8 +103,8 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_strings)
"err_load_crypto_strings_int()\n");
# endif
ret = err_load_crypto_strings_int();
-#endif
load_crypto_strings_inited = 1;
+#endif
return ret;
}