On Wed, Jan 07, 2026 at 09:22:39PM +0200, Andy Shevchenko wrote:
> 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.

Also note, when do a series, make sure you have the same version for all
patches and the cover letter provided. You can use `b4` tool for that or
supply `git format-patch -v<X> --cover-letter ...`, where <X> is the desired
version number.

-- 
With Best Regards,
Andy Shevchenko



Reply via email to