tty_in will never be stderr, so it will always be closed, which means stdin
[openssl.git] / crypto / ui / ui_openssl.c
index 6d5f9cd8b139d704212d35d07e326de7e93b3414..75318d48a14290ddd7dc84eeba9ba2486d368634 100644 (file)
@@ -449,7 +449,7 @@ error:
        ok=1;
 #endif
 
-       memset(result,0,BUFSIZ);
+       OPENSSL_cleanse(result,BUFSIZ);
        return ok;
        }
 
@@ -550,7 +550,7 @@ static int echo_console(UI *ui)
 
 static int close_console(UI *ui)
        {
-       if (tty_in != stderr) fclose(tty_in);
+       if (tty_in != stdin) fclose(tty_in);
        if (tty_out != stderr) fclose(tty_out);
 #ifdef OPENSSL_SYS_VMS
        status = sys$dassgn(channel);