]> git.ipfire.org Git - thirdparty/grub.git/commit
disk: Use safe math macros to prevent overflows
authorAlec Brown <alec.r.brown@oracle.com>
Wed, 22 Jan 2025 02:55:09 +0000 (02:55 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 13 Feb 2025 14:45:56 +0000 (15:45 +0100)
commitc407724dad6c3e2fc1571e57adbda71cc03f82aa
treea23f7be56e5aa68543d8fe617d98d8ebc47d612c
parentc4bc55da28543d2522a939ba4ee0acde45f2fa74
disk: Use safe math macros to prevent overflows

Replace direct arithmetic operations with macros from include/grub/safemath.h
to prevent potential overflow issues when calculating the memory sizes.

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/cryptodisk.c
grub-core/disk/diskfilter.c
grub-core/disk/ieee1275/obdisk.c
grub-core/disk/ieee1275/ofdisk.c
grub-core/disk/ldm.c
grub-core/disk/luks2.c
grub-core/disk/memdisk.c
grub-core/disk/plainmount.c