[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Fri Jun 3 16:08:25 UTC 2016


The branch master has been updated
       via  7d6df9e9150abc8e0d8f88b02159261e37eea167 (commit)
      from  b38c43f7bc474c369ed652b19360ec90458be516 (commit)


- Log -----------------------------------------------------------------
commit 7d6df9e9150abc8e0d8f88b02159261e37eea167
Author: Pauli <paul.dale at oracle.com>
Date:   Fri Jun 3 10:52:32 2016 -0400

    Fix threading issue that at best will leak memory
    
    The problem is the checking in policy_cache_set, there is a race
    condition between the null check and obtaining the lock.  The fix is in
    policy_cache_new to detect if the creation has happened already.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 crypto/x509v3/pcy_cache.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/crypto/x509v3/pcy_cache.c b/crypto/x509v3/pcy_cache.c
index e254142..a9ee30a 100644
--- a/crypto/x509v3/pcy_cache.c
+++ b/crypto/x509v3/pcy_cache.c
@@ -78,6 +78,9 @@ static int policy_cache_new(X509 *x)
     CERTIFICATEPOLICIES *ext_cpols = NULL;
     POLICY_MAPPINGS *ext_pmaps = NULL;
     int i;
+
+    if (x->policy_cache != NULL)
+        return 1;
     cache = OPENSSL_malloc(sizeof(*cache));
     if (cache == NULL)
         return 0;


More information about the openssl-commits mailing list