[openssl] openssl-3.0 update

Dr. Paul Dale pauli at openssl.org
Thu Feb 24 00:25:28 UTC 2022


The branch openssl-3.0 has been updated
       via  413ffdd1b6b6345f1b8891d1865fa090bcde5957 (commit)
      from  66d422c5738b74c6bd9d8b34e219eb98b6fcd60a (commit)


- Log -----------------------------------------------------------------
commit 413ffdd1b6b6345f1b8891d1865fa090bcde5957
Author: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Date:   Thu Feb 17 17:47:00 2022 +0800

    test/crltest.c: Add check for glue2bio
    
    As the glue2bio() could return NULL pointer if fails,
    it should be better to check the return value in order
    to avoid the use of NULL pointer.
    
    Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17718)
    
    (cherry picked from commit 18cb1740cc0fd11940836fa2fcaf6d3634c00e90)

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

Summary of changes:
 test/crltest.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/test/crltest.c b/test/crltest.c
index 5d255d368a..f258c75efe 100644
--- a/test/crltest.c
+++ b/test/crltest.c
@@ -200,9 +200,16 @@ static BIO *glue2bio(const char **pem, char **out)
  */
 static X509_CRL *CRL_from_strings(const char **pem)
 {
+    X509_CRL *crl;
     char *p;
     BIO *b = glue2bio(pem, &p);
-    X509_CRL *crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);
+
+    if (b == NULL) {
+        OPENSSL_free(p);
+        return NULL;
+    }
+
+    crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);
 
     OPENSSL_free(p);
     BIO_free(b);
@@ -214,9 +221,16 @@ static X509_CRL *CRL_from_strings(const char **pem)
  */
 static X509 *X509_from_strings(const char **pem)
 {
+    X509 *x;
     char *p;
     BIO *b = glue2bio(pem, &p);
-    X509 *x = PEM_read_bio_X509(b, NULL, NULL, NULL);
+
+    if (b == NULL) {
+        OPENSSL_free(p);
+        return NULL;
+    }
+
+    x = PEM_read_bio_X509(b, NULL, NULL, NULL);
 
     OPENSSL_free(p);
     BIO_free(b);
@@ -363,6 +377,12 @@ static int test_reuse_crl(void)
     char *p;
     BIO *b = glue2bio(kRevokedCRL, &p);
 
+    if (b == NULL) {
+        OPENSSL_free(p);
+        X509_CRL_free(reused_crl);
+        return 0;
+    }
+
     reused_crl = PEM_read_bio_X509_CRL(b, &reused_crl, NULL, NULL);
 
     OPENSSL_free(p);


More information about the openssl-commits mailing list