HomeFreeBSD

stand/multiboot2: fix header length check

Description

stand/multiboot2: fix header length check

Check whether we have reached the end of the buffer using search_size
instead of MULTIBOOT_SEARCH, which is the maximum defined by the
specification, but the file can be shorter than that.

This prevents printing a harmless error message when loading a file
that is smaller than MULTIBOOT_SEARCH.

Sponsored by: Citrix Systems R&D
MFC after: 3 days
Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode')

Details

Provenance
roygerAuthored on Feb 23 2021, 2:56 PM
Parents
rGab379c15af6f: stand/multiboot2: fix error message format
Branches
Unknown
Tags
Unknown