From 97c41e121620796a77f04965a0c839f87eb50290 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 10:53:31 +0300 Subject: [PATCH] efiemu: fix unintended sign extension Found by: Coverity scan. CID: 73883, 73637 --- grub-core/efiemu/loadcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/efiemu/loadcore.c b/grub-core/efiemu/loadcore.c index 6968b3719..e68e7e4d1 100644 --- a/grub-core/efiemu/loadcore.c +++ b/grub-core/efiemu/loadcore.c @@ -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);