[openssl] master update

tomas at openssl.org tomas at openssl.org
Wed Feb 16 10:10:29 UTC 2022


The branch master has been updated
       via  17da5f2af833ef16cc2e431359139a4a2e3775b9 (commit)
      from  b926548b362531e8a64e7482c081611fab7183a8 (commit)


- Log -----------------------------------------------------------------
commit 17da5f2af833ef16cc2e431359139a4a2e3775b9
Author: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Date:   Tue Feb 15 10:46:38 2022 +0800

    test/helpers/handshake.c: Add check for OPENSSL_strdup
    
    As the potential failure of the memory allocation, the OPENSSL_strdup()
    could return NULL pointer and then be assigned to 'server_ctx'.
    In order to tell the callers the failure of the configuration, it should
    be better to return error.
    
    Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17705)

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

Summary of changes:
 test/helpers/handshake.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c
index 7171f90473..cee11bbc18 100644
--- a/test/helpers/handshake.c
+++ b/test/helpers/handshake.c
@@ -633,6 +633,8 @@ static int configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
     if (extra->server.session_ticket_app_data != NULL) {
         server_ctx_data->session_ticket_app_data =
             OPENSSL_strdup(extra->server.session_ticket_app_data);
+        if (!TEST_ptr(server_ctx_data->session_ticket_app_data))
+            goto err;
         SSL_CTX_set_session_ticket_cb(server_ctx, generate_session_ticket_cb,
                                       decrypt_session_ticket_cb, server_ctx_data);
     }
@@ -641,6 +643,8 @@ static int configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
             goto err;
         server2_ctx_data->session_ticket_app_data =
             OPENSSL_strdup(extra->server2.session_ticket_app_data);
+        if (!TEST_ptr(server2_ctx_data->session_ticket_app_data))
+            goto err;
         SSL_CTX_set_session_ticket_cb(server2_ctx, NULL,
                                       decrypt_session_ticket_cb, server2_ctx_data);
     }


More information about the openssl-commits mailing list