[PATCH] i2c: sun6i-pw2i: Prefer strscpy over strlcpy

Wolfram Sang wsa at kernel.org
Tue Aug 17 12:36:28 PDT 2021


On Tue, Aug 17, 2021 at 06:58:59PM +0200, Len Baker wrote:
> strlcpy() reads the entire source buffer first. This read may exceed the
> destination size limit. This is both inefficient and can lead to linear
> read overflows if a source string is not NUL-terminated. The safe
> replacement is strscpy().
> 
> This is a previous step in the path to remove the strlcpy() function
> entirely from the kernel [1].
> 
> [1] https://github.com/KSPP/linux/issues/89
> 
> Signed-off-by: Len Baker <len.baker at gmx.com>

Applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210817/cfb4cd36/attachment.sig>


More information about the linux-arm-kernel mailing list