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

2021-02-08 Thread Petr Mladek
On Fri 2021-02-05 14:50:56, Andy Shevchenko wrote: > On Fri, Feb 5, 2021 at 1:35 PM Richard Fitzgerald > wrote: > > On 04/02/2021 16:35, Petr Mladek wrote: > > > On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: > > >> On Wed, Feb 03, 2021 at 04:50:07PM +, Richard Fitzgerald wrote: > > >>

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

2021-02-08 Thread Richard Fitzgerald
On 04/02/2021 16:35, Petr Mladek wrote: On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: On Wed, Feb 03, 2021 at 04:50:07PM +, 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

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

2021-02-05 Thread Andy Shevchenko
On Fri, Feb 5, 2021 at 5:23 PM David Laight wrote: > From: Andy Shevchenko > > Sent: 05 February 2021 12:51 > > On Fri, Feb 5, 2021 at 1:35 PM Richard Fitzgerald > > wrote: > > > On 04/02/2021 16:35, Petr Mladek wrote: > > > > On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: > > > >> On Wed,

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

2021-02-05 Thread David Laight
From: Andy Shevchenko > Sent: 05 February 2021 12:51 > > On Fri, Feb 5, 2021 at 1:35 PM Richard Fitzgerald > wrote: > > On 04/02/2021 16:35, Petr Mladek wrote: > > > On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: > > >> On Wed, Feb 03, 2021 at 04:50:07PM +, Richard Fitzgerald wrote: > >

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

2021-02-05 Thread Andy Shevchenko
On Fri, Feb 5, 2021 at 1:35 PM Richard Fitzgerald wrote: > On 04/02/2021 16:35, Petr Mladek wrote: > > On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: > >> On Wed, Feb 03, 2021 at 04:50:07PM +, Richard Fitzgerald wrote: ... > >>> + for (; max_chars > 0; max_chars--) { > >> > >> Less

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

2021-02-05 Thread Richard Fitzgerald
On 04/02/2021 16:35, Petr Mladek wrote: On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: On Wed, Feb 03, 2021 at 04:50:07PM +, 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

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

2021-02-04 Thread Petr Mladek
On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: > On Wed, Feb 03, 2021 at 04:50:07PM +, 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

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

2021-02-03 Thread Andy Shevchenko
On Wed, Feb 03, 2021 at 04:50:07PM +, 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

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

2021-02-03 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