[openssl] master update

Dr. Paul Dale pauli at openssl.org
Wed Sep 9 08:01:46 UTC 2020


The branch master has been updated
       via  b7a8fb52a95d606e073a6f232262cc121659a1fe (commit)
      from  e942111267f292070cbc8397e0cc5fddaf8371a0 (commit)


- Log -----------------------------------------------------------------
commit b7a8fb52a95d606e073a6f232262cc121659a1fe
Author: Pauli <paul.dale at oracle.com>
Date:   Tue Sep 8 07:35:29 2020 +1000

    s_time: check return values better
    
    Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
    Reviewed-by: Ben Kaduk <kaduk at mit.edu>
    (Merged from https://github.com/openssl/openssl/pull/12808)

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

Summary of changes:
 apps/s_time.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/apps/s_time.c b/apps/s_time.c
index ac9c72e622..3730ca540a 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -416,12 +416,19 @@ static SSL *doConnection(SSL *scon, const char *host, SSL_CTX *ctx)
     if ((conn = BIO_new(BIO_s_connect())) == NULL)
         return NULL;
 
-    BIO_set_conn_hostname(conn, host);
-    BIO_set_conn_mode(conn, BIO_SOCK_NODELAY);
+    if (BIO_set_conn_hostname(conn, host) <= 0
+            || BIO_set_conn_mode(conn, BIO_SOCK_NODELAY) <= 0) {
+        BIO_free(conn);
+        return NULL;
+    }
 
-    if (scon == NULL)
+    if (scon == NULL) {
         serverCon = SSL_new(ctx);
-    else {
+        if (serverCon == NULL) {
+            BIO_free(conn);
+            return NULL;
+        }
+    } else {
         serverCon = scon;
         SSL_set_connect_state(serverCon);
     }


More information about the openssl-commits mailing list