Re: [PATCH] lib: string_helpers: fix potential snprintf() output truncation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 22, 2024 at 10:15 AM Jiri Slaby <jirislaby@xxxxxxxxxx> wrote:
>
> On 21. 10. 24, 12:04, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> >
> > The output of ".%03u" with the unsigned int in range [0, 4294966295] may
> > get truncated if the target buffer is not 12 bytes.
>
> Perhaps, if you elaborate on how 'remainder' can become > 999?

The problem here that we have a two-way road: on one hand we ought to
fix the bugs in the kernel, on the other hand the compiler warnings
(even false positives) better to be fixed as we don't know which
compiler gets it fixed, but now we have a problem with building with
`make W=1` for the default configurations (it prevents build due to
compilation errors), so this change is definitely is an improvement.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux