summaryrefslogtreecommitdiffstats
path: root/arch/mips/cavium-octeon
diff options
context:
space:
mode:
authorJason Wang <wangborong@cdjrlc.com>2021-09-06 21:49:23 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-12-16 15:56:25 +0100
commit906c6bc6e8e5c00cf76488e3023759fdfd6a18af (patch)
treef7734aaa0001f825f4709e22e7e16a9ce8ecec60 /arch/mips/cavium-octeon
parenta670c82d9ca4f1e7385d9d6f26ff41a50fbdd944 (diff)
downloadlinux-906c6bc6e8e5c00cf76488e3023759fdfd6a18af.tar.bz2
MIPS: BCM47XX: Replace strlcpy with strscpy
The strlcpy should not be used because it doesn't limit the source length. As linus says, it's a completely useless function if you can't implicitly trust the source string - but that is almost always why people think they should use it! All in all the BSD function will lead some potential bugs. But the strscpy doesn't require reading memory from the src string beyond the specified "count" bytes, and since the return value is easier to error-check than strlcpy()'s. In addition, the implementation is robust to the string changing out from underneath it, unlike the current strlcpy() implementation. Thus, We prefer using strscpy instead of strlcpy. Signed-off-by: Jason Wang <wangborong@cdjrlc.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/cavium-octeon')
0 files changed, 0 insertions, 0 deletions