[openssl] master update

Dr. Paul Dale pauli at openssl.org
Fri Jan 14 06:06:38 UTC 2022


The branch master has been updated
       via  8c870f6bed241ec80c67453e60592461f0d8f2b8 (commit)
      from  79c7acc59bb98c2b8451b048ed1dd8cc517df76e (commit)


- Log -----------------------------------------------------------------
commit 8c870f6bed241ec80c67453e60592461f0d8f2b8
Author: Pauli <ppzgs1 at gmail.com>
Date:   Thu Jan 13 12:30:59 2022 +1100

    coverity 1497107: dereference after null check
    
    Add null checks to avoid dereferencing a pointer that could be null.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/17488)

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

Summary of changes:
 apps/lib/apps.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 7ca30ef590..77edc1d936 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -691,10 +691,13 @@ int load_cert_certs(const char *uri,
     if (ret) {
         if (pcert != NULL)
             warn_cert(uri, *pcert, 0, vpm);
-        warn_certs(uri, *pcerts, 1, vpm);
+        if (pcerts != NULL)
+            warn_certs(uri, *pcerts, 1, vpm);
     } else {
-        OSSL_STACK_OF_X509_free(*pcerts);
-        *pcerts = NULL;
+        if (pcerts != NULL) {
+            OSSL_STACK_OF_X509_free(*pcerts);
+            *pcerts = NULL;
+        }
     }
     return ret;
 }


More information about the openssl-commits mailing list