grub/grub-core
Lidong Chen 86e8f2c4b0 osdep/unix/hostdisk: Fix signed integer overflow
The potential overflow issue arises at "size += ret;" because "size"
is of type ssize_t (signed) while "len" is size_t (unsigned). Repeatedly
adding read sizes, "ret", to "size" can potentially exceed the maximum
value of ssize_t, causing it to overflow into a negative or incorrect value.
The fix is to ensure "len" is within the range of SSIZE_MAX.

Fixes: CID 473850
Fixes: CID 473863

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2025-06-12 18:56:24 +02:00
..
2025-05-06 17:14:04 +02:00
2023-01-19 17:39:04 +01:00
2024-06-06 16:55:15 +02:00
2024-11-28 21:50:54 +01:00
2025-02-26 19:34:57 +01:00
2017-05-03 12:49:31 +02:00
2017-05-03 12:49:31 +02:00