loader/i386/linux: Cast left shift to grub_uint32_t
The Coverity complains that we might overflow into a negative value when setting linux_params.kernel_alignment to (1 << align). We can remedy this by casting it to grub_uint32_t. Fixes: CID 473876 Signed-off-by: Alec Brown <alec.r.brown@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
a8d6b06331
commit
490a6ab71c
@ -806,7 +806,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
||||
}
|
||||
|
||||
linux_params.code32_start = prot_mode_target + lh.code32_start - GRUB_LINUX_BZIMAGE_ADDR;
|
||||
linux_params.kernel_alignment = (1 << align);
|
||||
linux_params.kernel_alignment = ((grub_uint32_t) 1 << align);
|
||||
linux_params.ps_mouse = linux_params.padding11 = 0;
|
||||
linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user