RE: [PATCH v3 2/2] auxdisplay: charlcd: Deduplicate simple_strtoul()

David Laight
2019-07-08T13:42:36Z

> > simple_strtoul() tries to detect the base even when it has been
> > explicitely specified.
>
> I can't see it from the code. Can you point out to this drastic bug that has to
> be fixed?
>
> > I am afraid that it might cause some
> > regressions.
> >
> > For example, the following input is strange but it is valid:
> >
> > x0x10; new code would return (16, <orig_y>) instead of (10, <orig_y>)
> > x010; new code would return (8, <orig_y>) instead of (10, <orig_y>)

While having simple_stroul("0x10", 10) use base 16 is possibly not unreasonable,
using base 8 for simple_strtoul("010", 10) is just plain wrong.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)