efiemu: fix unintended sign extension

Found by: Coverity scan.
CID: 73883, 73637
This commit is contained in:
Andrei Borzenkov committed 2016-01-09 11:36:42 +03:00
1 parent 8ab2675ede
commit 97c41e1216
1 file changed
+1 -1
+1 -1
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);