Re: [PATCH] usb: core: devices: use scnprintf() instead of sprintf()

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

 



On Wed, Apr 20, 2022 at 11:04:00PM +0300, Sergey Shtylyov wrote:
> Hello!
> 
> On 4/20/22 9:40 AM, Greg Kroah-Hartman wrote:
> 
>    Thanks for the (unusually?) prompt reply! :-)
> 
> >> The USB device dump code uses the sprintf() calls with a 2-page buffer,
> >> leaving 256 bytes at the end of that buffer to prevent buffer overflow.
> >> Using scnprntf() instead eliminates the very possibility of the buffer
> >> overflow, while also simplifying the code. This however is achieved at
> >> the expense of not printing the "(truncated)" line anymore when the end
> >> of that buffer is actually reached; instead a possible partial line at
> >> the end of buffer (not ending with '\n') is now not printed.
> > 
> > So you just changed a user-visable abi :(
> 
>     debugfs is an ABI too? :-)

When we have tools that we know parse it, yes it can be.

But here you are just changing the existing format for no good reason,
which is generally considered a bad thing.

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux