]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/ui/ui_openssl.c
Always check CRYPTO_LOCK_{read,write}_lock
[thirdparty/openssl.git] / crypto / ui / ui_openssl.c
index 0a38658c72a6cc151bbbe4db83d70126e542ea6f..42524d42a282d75807b72b846c9bea8952506d34 100644 (file)
@@ -372,7 +372,8 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
 /* Internal functions to open, handle and close a channel to the console.  */
 static int open_console(UI *ui)
 {
-    CRYPTO_THREAD_write_lock(ui->lock);
+    if (!CRYPTO_THREAD_write_lock(ui->lock))
+        return 0;
     is_a_tty = 1;
 
 # if defined(OPENSSL_SYS_VXWORKS)