[openssl] master update

tomas at openssl.org tomas at openssl.org
Tue Jan 25 17:15:59 UTC 2022


The branch master has been updated
       via  7625d70ad9e7be0588dd9453e89892c2b24b8175 (commit)
       via  2208ba56ebefe4cf7d924e2ac7044ccd3307250b (commit)
      from  954f45ba4c504570206ff5bed811e512cf92dc8e (commit)


- Log -----------------------------------------------------------------
commit 7625d70ad9e7be0588dd9453e89892c2b24b8175
Author: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Date:   Mon Jan 24 11:18:38 2022 +0800

    test/ct_test.c: Add the missing check after calling sk_SCT_new_null
    
    As the potential failure of the allocation, the sk_SCT_new_null() could
    return NULL pointer if fails.
    And then sk_SCT_push() uses the 'fixture->sct_list' and returns -1 if
    fails.
    But the return value of the sk_SCT_push() is not checked.
    I think it is better to check it just after the allocation.
    
    CLA: trivial
    
    Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17571)

commit 2208ba56ebefe4cf7d924e2ac7044ccd3307250b
Author: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Date:   Mon Jan 24 11:06:34 2022 +0800

    evp_test: Add the missing check after calling OPENSSL_malloc
    
    The OPENSSL_zalloc() could return NULL pointer if fails.
    Add the check for it does make sense, like how digest_test_init() deals
    with.
    
    CLA: trivial
    
    Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17571)

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

Summary of changes:
 test/ct_test.c  | 3 +++
 test/evp_test.c | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/ct_test.c b/test/ct_test.c
index d1799fa7a2..f914ee514a 100644
--- a/test/ct_test.c
+++ b/test/ct_test.c
@@ -449,6 +449,9 @@ static int test_encode_tls_sct(void)
     SETUP_CT_TEST_FIXTURE();
 
     fixture->sct_list = sk_SCT_new_null();
+    if (fixture->sct_list == NULL)
+	    return 0;
+
     if (!TEST_ptr(sct = SCT_new_from_base64(SCT_VERSION_V1, log_id,
                                             CT_LOG_ENTRY_TYPE_X509, timestamp,
                                             extensions, signature)))
diff --git a/test/evp_test.c b/test/evp_test.c
index 871f2a9c6b..34caec2c5d 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -588,7 +588,9 @@ static int cipher_test_init(EVP_TEST *t, const char *alg)
     }
     ERR_clear_last_mark();
 
-    cdat = OPENSSL_zalloc(sizeof(*cdat));
+    if (!TEST_ptr(cdat = OPENSSL_zalloc(sizeof(*cdat))))
+        return 0;
+
     cdat->cipher = cipher;
     cdat->fetched_cipher = fetched_cipher;
     cdat->enc = -1;
@@ -1195,7 +1197,9 @@ static int mac_test_init(EVP_TEST *t, const char *alg)
             return 0;
     }
 
-    mdat = OPENSSL_zalloc(sizeof(*mdat));
+    if (!TEST_ptr(mdat = OPENSSL_zalloc(sizeof(*mdat))))
+        return 0;
+
     mdat->type = type;
     mdat->mac_name = OPENSSL_strdup(alg);
     mdat->mac = mac;


More information about the openssl-commits mailing list