diff options
author | Azeem Shaikh | 2023-07-03 17:58:40 +0000 |
---|---|---|
committer | David S. Miller | 2023-07-04 19:40:16 +0100 |
commit | ba7bdec3cbec7b0135f7ec0458073cbe9ae74de5 (patch) | |
tree | bbb0dc5af2371242ac839a5078b51920ec34bbb2 /net | |
parent | 84bef5b6037c15180ef88ac4216dc621d16df1a6 (diff) |
net: Replace strlcpy with strscpy
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 [1].
In an effort to remove strlcpy() completely [2], replace
strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions