loader: Unintended sign extension

CID: 96707, 96699, 96693, 96691, 96711, 96709, 96708, 96703, 96702,
96700, 96698, 96696, 96695, 96692, 96710, 96705
This commit is contained in:
Andrei Borzenkov 2016-01-13 20:15:07 +03:00
parent b95e926788
commit 4f8fe948b9
3 changed files with 15 additions and 15 deletions

View file

@ -605,7 +605,7 @@ grub_dl_load_core_noinit (void *addr, grub_size_t size)
}
/* Make sure that every section is within the core. */
if (size < e->e_shoff + e->e_shentsize * e->e_shnum)
if (size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum)
{
grub_error (GRUB_ERR_BAD_OS, "ELF sections outside core");
return 0;