1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-13 17:18:18 +03:00

efi: check input parameter

clang complained about an unused variable. We cast the buffer to
struct boot_params, so let's check that it's at least this long.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-10-20 13:57:38 +02:00
parent f3611cfb0b
commit 2fffe2ed19

View File

@ -138,6 +138,9 @@ EFI_STATUS linux_exec(
assert(linux_buffer);
assert(initrd_buffer || initrd_length == 0);
if (linux_length < sizeof(struct boot_params))
return EFI_LOAD_ERROR;
image_params = (const struct boot_params *) linux_buffer;
if (image_params->hdr.boot_flag != 0xAA55 ||