]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Check setting of master key value
authorNeil Horman <nhorman@openssl.org>
Tue, 17 Jun 2025 14:53:58 +0000 (10:53 -0400)
committerNeil Horman <nhorman@openssl.org>
Fri, 20 Jun 2025 17:01:39 +0000 (13:01 -0400)
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27794)

crypto/threads_common.c

index b47aae17f82db9663b4f4f1ac779a9c46827aef7..d5ef08413da724923d4cd5844080a38445bec635 100644 (file)
@@ -358,7 +358,10 @@ int CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_KEY_ID id,
         /*
          * make sure to assign it to our master key thread-local storage
          */
-        CRYPTO_THREAD_set_local(&master_key, mkey);
+        if (!CRYPTO_THREAD_set_local(&master_key, mkey)) {
+            OPENSSL_free(mkey);
+            return 0;
+        }
     }
 
     /*