efiemu: fix unintended sign extension

Found by: Coverity scan.
CID: 73883, 73637
This commit is contained in:
Andrei Borzenkov 2016-01-09 10:53:31 +03:00
parent 8ab2675ede
commit 97c41e1216
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ SUFFIX (grub_efiemu_loadcore_init) (void *core, const char *filename,
return grub_error (GRUB_ERR_BAD_MODULE, N_("this ELF file is not of the right type"));
/* Make sure that every section is within the core. */
if ((grub_size_t) core_size < e->e_shoff + e->e_shentsize * e->e_shnum)
if ((grub_size_t) core_size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum)
return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
filename);