grub/grub-core
Lidong Chen 8c2d4e64ff normal/charset: Fix underflow and overflow in loop init
In bidi_line_wrap(), "kk - 1" in the for loop init, "i = kk - 1",
underflows when "kk" (unsigned int) is 0. Assigning the result of
"kk - 1" to signed int "i" may cause overflow. To address both
issues, cast "kk" to a signed type before subtraction to ensure
safe arithmetic and assignment.

Fixed: CID 473874

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
2025-06-26 17:19:25 +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