Re: [PATCH] lib/string_helpers: rework overflow-dependent code
From: Andy Shevchenko
Date: Thu Aug 08 2024 - 18:08:28 EST
On Fri, Aug 9, 2024 at 12:44 AM Justin Stitt <justinstitt@xxxxxxxxxx> wrote:
>
> When @size is 0, the desired behavior is to allow unlimited bytes to be
> parsed. Currently, this relies on some intentional arithmetic overflow
> where --size gives us SIZE_MAX when size is 0.
>
> Explicitly spell out the desired behavior without relying on intentional
> overflow/underflow.
Hmm... but why? Overflow for the _unsigned_ types is okay. No?
--
With Best Regards,
Andy Shevchenko