[openssl/openssl] 31295c: Fix calling pthread_key_delete on uninitialized data

Petr Mikhalitsyn noreply at github.com
Mon Apr 24 09:34:38 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 31295ca02c0a2d7209a33047c7f6dd1dabc12c93
      https://github.com/openssl/openssl/commit/31295ca02c0a2d7209a33047c7f6dd1dabc12c93
  Author: Petr Mikhalicin <mkh199740 at mail.ru>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M crypto/context.c

  Log Message:
  -----------
  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 at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20801)




More information about the openssl-commits mailing list