Bartosz Golaszewski a44a4260a2 lib: string_helpers: silence snprintf() output truncation warning
commit a508ef4b1dcc82227edc594ffae583874dd425d7 upstream.

The output of ".%03u" with the unsigned int in range [0, 4294966295] may
get truncated if the target buffer is not 12 bytes. This can't really
happen here as the 'remainder' variable cannot exceed 999 but the
compiler doesn't know it. To make it happy just increase the buffer to
where the warning goes away.

Fixes: 3c9f3681d0b4 ("[SCSI] lib: add generic helper to print sizes rounded to the correct SI range")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Kees Cook <kees@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20241101205453.9353-1-brgl@bgdev.pl
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:48:12 +01:00
..
2024-07-18 13:05:40 +02:00
2024-10-17 15:07:50 +02:00
2020-05-24 20:48:11 +02:00
2018-08-16 12:14:42 -07:00
2022-06-22 14:13:18 +02:00
2020-10-13 18:38:32 -07:00
2022-06-22 14:13:18 +02:00
2018-10-16 13:45:44 +02:00
2022-06-22 14:13:18 +02:00
2019-07-11 15:17:41 -07:00
2020-09-26 10:33:57 -07:00
2020-06-29 10:02:23 +02:00
2023-06-21 15:45:35 +02:00
2020-06-07 10:53:36 -07:00