From c45ab5b8de0c662917ec26e81bc1c87fa8095a4f Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Mon, 23 Jun 2025 14:49:11 +0200 Subject: [PATCH] init_master_key(): Check return of CRYPTO_THREAD_init_local() Fixes Coverity 1649566 Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/27880) --- crypto/threads_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/threads_common.c b/crypto/threads_common.c index c255c87df91..024c0eb53d6 100644 --- a/crypto/threads_common.c +++ b/crypto/threads_common.c @@ -222,7 +222,8 @@ static void init_master_key(void) * (that is assigned via CRYPTO_THREAD_set_local_ex), are still expected * to be cleaned via the ossl_init_thread_start/stop api. */ - CRYPTO_THREAD_init_local(&master_key, clean_master_key); + if (!CRYPTO_THREAD_init_local(&master_key, clean_master_key)) + return; /* * Indicate that the key has been set up. -- 2.47.2