mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 07:39:22 +00:00
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:
1 parent
a8d6b06331
commit
490a6ab71c
1 file changed
+1
-1
@@ -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.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.ps_mouse = linux_params.padding11 = 0;
|
||||||
linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
|
linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user