]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix calling pthread_key_delete on uninitialized data
authorPetr Mikhalicin <mkh199740@mail.ru>
Fri, 21 Apr 2023 09:25:43 +0000 (12:25 +0300)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 Apr 2023 09:31:57 +0000 (11:31 +0200)
commit31295ca02c0a2d7209a33047c7f6dd1dabc12c93
treedd1ea7c9d3d95a2ccc0318f4e2934ea6e6c50069
parentc04e78f0c69201226430fed14c291c281da47f2d
Fix calling pthread_key_delete on uninitialized data

default_context_do_init may be never called and CRYPTO_THREAD_init_local
inside it may be never called too. But corresponding
CRYPTO_THREAD_cleanup_local is always called at cleanup stage. This lead
to undefined behavior.

So, add flag to check that default_context_do_init will be called
successfully or not.

Fix: #20697

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20801)
crypto/context.c