diff --git a/src/boot/efi/linux_x86.c b/src/boot/efi/linux_x86.c index 98b2366ad28..15052bdff65 100644 --- a/src/boot/efi/linux_x86.c +++ b/src/boot/efi/linux_x86.c @@ -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 ||