[openssl] master update

Matt Caswell matt at openssl.org
Mon Mar 30 13:53:25 UTC 2020


The branch master has been updated
       via  c2146b57d296aa5b06e27cd8d76bbd040a3444b9 (commit)
      from  743d9c16deee09bdd336a96170eb3e117508db1b (commit)


- Log -----------------------------------------------------------------
commit c2146b57d296aa5b06e27cd8d76bbd040a3444b9
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Mar 27 16:05:36 2020 +0000

    Don't attempt to up-ref an EVP_CIPHER if it is NULL
    
    EVP_CIPHERs in the ssl_cipher_methods table can be NULL if
    they are not available. We shouldn't attempt to up-ref a
    cipher if it is NULL.
    
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/11426)

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

Summary of changes:
 ssl/ssl_ciph.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 23d156a702..745afae630 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -457,7 +457,10 @@ int ssl_cipher_get_evp_cipher(SSL_CTX *ctx, const SSL_CIPHER *sslc,
             if (*enc == NULL)
                 return 0;
         } else {
-            if (!ssl_evp_cipher_up_ref(ctx->ssl_cipher_methods[i]))
+            const EVP_CIPHER *cipher = ctx->ssl_cipher_methods[i];
+
+            if (cipher == NULL
+                    || !ssl_evp_cipher_up_ref(cipher))
                 return 0;
             *enc = ctx->ssl_cipher_methods[i];
         }


More information about the openssl-commits mailing list