Re: [PATCH] bcachefs: Use snprintf() instead of scnprintf() when appropriate

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

 



On Tue, Sep 19, 2023 at 09:17:27AM -0400, Brian Foster wrote:
> On Sat, Sep 16, 2023 at 09:30:19AM +0200, Christophe JAILLET wrote:
> > snprintf() and scnprintf() are the same, except for the returned value.
> > When this value is not used, it is more logical to use snprintf() which is
> > slightly simpler.
> > 
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> > ---
> 
> Seems reasonable:
> 
> Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

No, let's stay with scnprintf as the default - snprintf should be
deprecated except for when its return value is actually needed, using it
incorrectly has been a source of buffer overruns in the past.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux