Re: [PATCH v2] lib: string_helpers: silence snprintf() output truncation warning

2024-11-02 Thread Kees Cook
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 kn

[PATCH v2] lib: string_helpers: silence snprintf() output truncation warning

2024-11-01 Thread Bartosz Golaszewski
From: Bartosz Golaszewski 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 b