[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Rich Salz rsalz at openssl.org
Wed May 13 16:56:51 UTC 2015


The branch OpenSSL_1_0_2-stable has been updated
       via  f34b095fab1569d093b639bfcc9a77d6020148ff (commit)
      from  d3bb25e30ac1e07ce3b163655d8d33bc9f1186e3 (commit)


- Log -----------------------------------------------------------------
commit f34b095fab1569d093b639bfcc9a77d6020148ff
Author: Rich Salz <rsalz at akamai.com>
Date:   Tue May 12 11:49:32 2015 -0400

    Add NULL checks from master
    
    The big "don't check for NULL" cleanup requires backporting some
    of the lowest-level functions to actually do nothing if NULL is
    given.  This will make it easier to backport fixes to release
    branches, where master assumes those lower-level functions are "safe"
    
    This commit addresses those tickets: 3798 3799 3801.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>

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

Summary of changes:
 crypto/cmac/cmac.c     | 2 ++
 crypto/x509/x509_lu.c  | 2 ++
 crypto/x509/x509_vfy.c | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/crypto/cmac/cmac.c b/crypto/cmac/cmac.c
index c5597a3..774e6dc 100644
--- a/crypto/cmac/cmac.c
+++ b/crypto/cmac/cmac.c
@@ -126,6 +126,8 @@ EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx)
 
 void CMAC_CTX_free(CMAC_CTX *ctx)
 {
+    if (!ctx)
+        return;
     CMAC_CTX_cleanup(ctx);
     OPENSSL_free(ctx);
 }
diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c
index ff1fa97..b0d6539 100644
--- a/crypto/x509/x509_lu.c
+++ b/crypto/x509/x509_lu.c
@@ -216,6 +216,8 @@ X509_STORE *X509_STORE_new(void)
 
 static void cleanup(X509_OBJECT *a)
 {
+    if (!a)
+        return;
     if (a->type == X509_LU_X509) {
         X509_free(a->data.x509);
     } else if (a->type == X509_LU_CRL) {
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index f3e9c56..b4e7983 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -2206,6 +2206,8 @@ X509_STORE_CTX *X509_STORE_CTX_new(void)
 
 void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
 {
+    if (!ctx)
+        return;
     X509_STORE_CTX_cleanup(ctx);
     OPENSSL_free(ctx);
 }


More information about the openssl-commits mailing list