From a8357b34edb23aebdb84ec6c5b4e038b4920ec4a Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 28 Mar 2018 16:08:30 +0200 Subject: AskConsolePwdInt: Use the same check for maximum allowed characters in all places. line_max parameter includes zero terminator. --- Library/PasswordLib/ConsolePassword.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/PasswordLib/ConsolePassword.c b/Library/PasswordLib/ConsolePassword.c index 6894b50..43e03e6 100644 --- a/Library/PasswordLib/ConsolePassword.c +++ b/Library/PasswordLib/ConsolePassword.c @@ -101,7 +101,7 @@ AskConsolePwdInt( break; } - if ((count >= line_max && + if ((count >= (line_max - 1) && key.UnicodeChar != CHAR_BACKSPACE) || key.UnicodeChar == CHAR_NULL || key.UnicodeChar == CHAR_TAB || -- cgit v1.2.3