Re: [PATCH] staging: qlge/qlge_ethtool.c: strlcpy -> strscpy

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

 



[Forgot to reply-all]

On 0129, Greg Kroah-Hartman wrote:
> On Fri, Jan 29, 2021 at 12:15:23PM +0530, Kumar Kartikeya Dwivedi wrote:
> > Fixes checkpatch warnings for usage of strlcpy.
> 
> What warning would that be?
> 

5dbdb2d87c294401a22e6a6002f08ebc9fbea38b

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5dbdb2d87c294401a22e6a6002f08ebc9fbea38b

> And if we could just search/replace for this, why hasn't that already
> happened for the whole tree?
>

I think that's because it is hard to tell whether truncation is expected at the
call site or not, so each change needs to be audited manually (to check the
return value or not). In cases where it's just a safe strcpy, strscpy is a
relatively better choice (due to not reading the entire source string).

> thanks,
> 
> greg k-h

--
Kartikeya
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux