efi_loader: compliance Simple Text Input Ex Protocol
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 1 Sep 2022 21:30:09 +0000 (23:30 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 3 Sep 2022 06:16:09 +0000 (08:16 +0200)
We cannot expect the buffers passed to the input protocols to be zero
filled. If only modifier keys are pressed, we have to return EFI_NOT_READY
but we still have to fill the key structure.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_console.c

index 3164fd4..1fcaabe 100644 (file)
@@ -987,6 +987,7 @@ static efi_status_t EFIAPI efi_cin_read_key_stroke_ex(
        efi_cin_check();
 
        if (!key_available) {
+               memset(key_data, 0, sizeof(struct efi_key_data));
                ret = EFI_NOT_READY;
                goto out;
        }