[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
Rich Salz
rsalz at openssl.org
Mon Jun 5 12:06:48 UTC 2017
The branch OpenSSL_1_1_0-stable has been updated
via c8ec34109cab8c92685958ddfef0776a4b3b8460 (commit)
from 3dbd32c4fe7cba6abb0e2b71313185d0a908478f (commit)
- Log -----------------------------------------------------------------
commit c8ec34109cab8c92685958ddfef0776a4b3b8460
Author: Rich Salz <rsalz at openssl.org>
Date: Wed May 31 12:14:55 2017 -0400
Only release thread-local key if we created it.
Thanks to Jan Alexander Steffens for finding the bug and confirming the
fix.
Reviewed-by: Richard Levitte <levitte at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3592)
(cherry picked from commit 73bc53708c386c1ea85941d345721e23dc61c05c)
-----------------------------------------------------------------------
Summary of changes:
crypto/err/err.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/crypto/err/err.c b/crypto/err/err.c
index f866f2f..c55f849 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -122,6 +122,7 @@ static ERR_STRING_DATA ERR_str_reasons[] = {
#endif
static CRYPTO_ONCE err_init = CRYPTO_ONCE_STATIC_INIT;
+static int set_err_thread_local;
static CRYPTO_THREAD_LOCAL err_thread_local;
static CRYPTO_ONCE err_string_init = CRYPTO_ONCE_STATIC_INIT;
@@ -260,7 +261,8 @@ DEFINE_RUN_ONCE_STATIC(do_err_strings_init)
void err_cleanup(void)
{
- CRYPTO_THREAD_cleanup_local(&err_thread_local);
+ if (set_err_thread_local != 0)
+ CRYPTO_THREAD_cleanup_local(&err_thread_local);
CRYPTO_THREAD_lock_free(err_string_lock);
err_string_lock = NULL;
}
@@ -639,6 +641,7 @@ void ERR_remove_state(unsigned long pid)
DEFINE_RUN_ONCE_STATIC(err_do_init)
{
+ set_err_thread_local = 1;
return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
}
More information about the openssl-commits
mailing list