Re: [PATCH v2] lib: string_helpers: silence snprintf() output truncation warning
From: Kees Cook
Date: Sat Nov 02 2024 - 16:09:35 EST
On Fri, 01 Nov 2024 21:54:53 +0100, Bartosz Golaszewski wrote:
> 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.
>
>
> [...]
Applied to for-next/hardening, thanks!
[1/1] lib: string_helpers: silence snprintf() output truncation warning
https://git.kernel.org/kees/c/a508ef4b1dcc
Take care,
--
Kees Cook