On Wed, Jan 07, 2026 at 09:36:13PM +0300, Dmitry Antipov wrote:
> Introduce 'memvalue()' which uses 'memparse()' to parse a string with
> optional memory suffix into a number and returns this number or ULLONG_MAX
> if the number is negative or an unrecognized character was encountered.
Reading the second patch in the series I do not think this one even needed. The
problem in the original code is that
int *res, _res;
...
*res = _res << something;
This is a UB for _res < 0. So, the code should never handle negative numbers to
begin with. That said the existing memparse() can be used directly.
If I missed something, it's because the commit message here is poorly written
in regard to negative number parsing.
--
With Best Regards,
Andy Shevchenko