summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorJason Wang <wangborong@cdjrlc.com>2021-08-30 16:05:31 +0300
committerDavid S. Miller <davem@davemloft.net>2021-08-31 13:30:53 +0300
commit995786ba0dab6c96780e411bf22347270e837c89 (patch)
tree8bea1f0315137fa52e373c0cd24249a08f044fea /net/unix/af_unix.c
parenta7314371b3f3e682bad8d814434e65f8682aade1 (diff)
downloadlinux-995786ba0dab6c96780e411bf22347270e837c89.tar.xz
dpaa2-eth: 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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions