[openssl] master update

tomas at openssl.org tomas at openssl.org
Mon Jan 3 09:58:12 UTC 2022


The branch master has been updated
       via  5bea0e2ee9bda4d9be6e88c79f2c1b411bb65351 (commit)
      from  da7db7ae6d7d1929893a58e41335c88e472fc364 (commit)


- Log -----------------------------------------------------------------
commit 5bea0e2ee9bda4d9be6e88c79f2c1b411bb65351
Author: Tomas Mraz <tomas at openssl.org>
Date:   Tue Dec 28 13:32:57 2021 +0100

    close_console: Always unlock as the lock is always held
    
    Fixes #17364
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17365)

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

Summary of changes:
 crypto/ui/ui_openssl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 8cf7a21d76..37b98910c7 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -551,6 +551,8 @@ static int echo_console(UI *ui)
 
 static int close_console(UI *ui)
 {
+    int ret = 1;
+
     if (tty_in != stdin)
         fclose(tty_in);
     if (tty_out != stderr)
@@ -560,12 +562,12 @@ static int close_console(UI *ui)
     if (status != SS$_NORMAL) {
         ERR_raise_data(ERR_LIB_UI, UI_R_SYSDASSGN_ERROR,
                        "status=%%X%08X", status);
-        return 0;
+        ret = 0;
     }
 # endif
     CRYPTO_THREAD_unlock(ui->lock);
 
-    return 1;
+    return ret;
 }
 
 # if !defined(OPENSSL_SYS_WINCE)


More information about the openssl-commits mailing list