Fix uninitialized memory when --pw-stdin is used with a pipe

This commit is contained in:
Sertonix 2025-04-27 17:12:00 +02:00 committed by Jonathan White
parent 12a623f7d7
commit 1705c2c94a
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01

View file

@ -105,7 +105,9 @@ namespace Utils
SetConsoleMode(hIn, mode);
#else
struct termios t;
tcgetattr(STDIN_FILENO, &t);
if (tcgetattr(STDIN_FILENO, &t) < 0) {
return;
}
if (enable) {
t.c_lflag |= ECHO;