]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
init_master_key(): Check return of CRYPTO_THREAD_init_local()
authorTomas Mraz <tomas@openssl.org>
Mon, 23 Jun 2025 12:49:11 +0000 (14:49 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 23 Jun 2025 12:49:11 +0000 (14:49 +0200)
Fixes Coverity 1649566

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27880)

crypto/threads_common.c

index c255c87df91424e561184f950e5d1ff96dd2cfa7..024c0eb53d63c7f92cf2079721143fd248a02fd5 100644 (file)
@@ -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.