From b2eba0d99e8d919ae3ecc437234ae7b83a9d8bb7 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 9 Dec 2019 21:10:18 +0000 Subject: [PATCH] MFC r355347: loader: ReadKeyStrokeEx may return partial keystrokes In some systems we can receive no scancode nor unicodechar values. PR: 240760 Reported by: Ariel Millennium Thornton --- stand/efi/libefi/efi_console.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index a8ed786f786..a17894da3f5 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -558,10 +558,11 @@ efi_readkey_ex(void) kp->UnicodeChar++; } } + if (kp->ScanCode == 0 && kp->UnicodeChar == 0) + return (false); + keybuf_inschar(kp); + return (true); } - - keybuf_inschar(kp); - return (true); } return (false); } -- 2.45.0