grub-module-verifier: fix unintended sign extension

Found by: Coverity scan.
CID: 156533, 156532
This commit is contained in:
Andrei Borzenkov committed 2016-01-09 11:36:42 +03:00
1 parent b4787552b0
commit efc04d65c7
1 file changed
+1 -1
+1 -1
View File
@@ -337,7 +337,7 @@ SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_mod
/* Make sure that every section is within the core. */
if (size < grub_target_to_host (e->e_shoff)
+ grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum))
+ (grub_uint32_t) grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum))
{
grub_util_error ("ELF sections outside core");
}