Commit 11b3dda
lib: vsprintf: scanf: Negative number must have field width > 1
If a signed number field starts with a '-' the field width must be > 1,
or unlimited, to allow at least one digit after the '-'.
This patch adds a check for this. If a signed field starts with '-'
and field_width == 1 the scanf will quit.
It is ok for a signed number field to have a field width of 1 if it
starts with a digit. In that case the single digit can be converted.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210514161206.30821-1-rf@opensource.cirrus.com1 parent 7f3d08b commit 11b3dda
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3526 | 3526 | | |
3527 | 3527 | | |
3528 | 3528 | | |
3529 | | - | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
3530 | 3533 | | |
| 3534 | + | |
3531 | 3535 | | |
3532 | 3536 | | |
3533 | 3537 | | |
| |||
0 commit comments