loader/multiboot: fix unintended sign extension
Found by: Coveruty scan. CID: 73700, 73763
This commit is contained in:
parent
9fecb0588e
commit
31f6506c57
1 changed files with 1 additions and 1 deletions
|
@ -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"));
|
||||
|
||||
/* 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");
|
||||
|
||||
phdr_base = (char *) buffer + ehdr->e_phoff;
|
||||
|
|
Loading…
Reference in a new issue