Re: [PATCH] normal/charset: Fix underflow and overflow in loop init

2025-06-23 Thread sudhakar
On 2025-06-19 00:54, Lidong Chen via Grub-devel wrote: 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 subtr

Re: [PATCH] normal/charset: Fix underflow and overflow in loop init

2025-06-23 Thread Daniel Kiper via Grub-devel
On Wed, Jun 18, 2025 at 07:24:23PM +, Lidong Chen wrote: > 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