Re: [PATCH v7 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-03-29 Thread Richard Fitzgerald
On 29/03/2021 14:36, Andy Shevchenko wrote: On Mon, Mar 29, 2021 at 01:08:22PM +0100, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing to extract the field out of the full converted value. If th

Re: [PATCH v7 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-03-29 Thread Andy Shevchenko
On Mon, Mar 29, 2021 at 01:08:22PM +0100, Richard Fitzgerald wrote: > The existing code attempted to handle numbers by doing a strto[u]l(), > ignoring the field width, and then repeatedly dividing to extract the > field out of the full converted value. If the string contains a run of > valid digits

[PATCH v7 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-03-29 Thread Richard Fitzgerald
The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing to extract the field out of the full converted value. If the string contains a run of valid digits longer than will fit in a long or long long, this would overflow and no amo