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

Matt Caswell matt at openssl.org
Mon May 11 10:55:50 UTC 2015


The branch OpenSSL_1_0_2-stable has been updated
       via  edc2a76ade6ea8e22e4f092d33cd6171872a5f82 (commit)
      from  8dfe1e4dd27c21a0ccebbb97d9b6a3612e8d54ef (commit)


- Log -----------------------------------------------------------------
commit edc2a76ade6ea8e22e4f092d33cd6171872a5f82
Author: Matt Caswell <matt at openssl.org>
Date:   Sat May 9 13:51:25 2015 +0800

    Check sk_SSL_CIPHER_new_null return value
    
    If sk_SSL_CIPHER_new_null() returns NULL then ssl_bytes_to_cipher_list()
    should also return NULL.
    
    Based on an original patch by mrpre <mrpre at 163.com>.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (cherry picked from commit 14def5f5375594830597cc153e11c6017f6adddf)

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

Summary of changes:
 ssl/ssl_lib.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 38426b4..b60fe1a 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1510,9 +1510,13 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, unsigned char *p,
                SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);
         return (NULL);
     }
-    if ((skp == NULL) || (*skp == NULL))
+    if ((skp == NULL) || (*skp == NULL)) {
         sk = sk_SSL_CIPHER_new_null(); /* change perhaps later */
-    else {
+        if(sk == NULL) {
+            SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
+            return NULL;
+        }
+    } else {
         sk = *skp;
         sk_SSL_CIPHER_zero(sk);
     }


More information about the openssl-commits mailing list