mirror of
https://git.proxmox.com/git/grub2
synced 2025-08-16 23:46:59 +00:00
loader/multiboot: fix unintended sign extension
Found by: Coveruty scan. CID: 73700, 73763
This commit is contained in:
parent
9fecb0588e
commit
31f6506c57
@ -72,7 +72,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi
|
|||||||
return grub_error (GRUB_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type"));
|
return grub_error (GRUB_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type"));
|
||||||
|
|
||||||
/* FIXME: Should we support program headers at strange locations? */
|
/* FIXME: Should we support program headers at strange locations? */
|
||||||
if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH)
|
if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH)
|
||||||
return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset");
|
return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset");
|
||||||
|
|
||||||
phdr_base = (char *) buffer + ehdr->e_phoff;
|
phdr_base = (char *) buffer + ehdr->e_phoff;
|
||||||
|
Loading…
Reference in New Issue
Block a user