From 1705c2c94afc17c1c764540a05d105d31c4840d3 Mon Sep 17 00:00:00 2001 From: Sertonix Date: Sun, 27 Apr 2025 17:12:00 +0200 Subject: [PATCH] Fix uninitialized memory when --pw-stdin is used with a pipe --- src/cli/Utils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/Utils.cpp b/src/cli/Utils.cpp index efceeab5e..712fe85f2 100644 --- a/src/cli/Utils.cpp +++ b/src/cli/Utils.cpp @@ -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;