net: xtensa: use strscpy to copy strings
authorJason Wang <wangborong@cdjrlc.com>
Mon, 20 Dec 2021 08:46:02 +0000 (16:46 +0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 22 Jan 2022 02:00:32 +0000 (18:00 -0800)
commit2d4a4aec2fe5ccc589e1522b7196fc0abf9d86c3
tree5b63a1db7aa4e0ae8f4137b798c2ece750564fac
parentdf0cc57e057f18e44dac8e6c18aba47ab53202f9
net: xtensa: use strscpy to copy strings

The strlcpy should not be used because it doesn't limit the source
length. So that it 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, replace strlcpy with strscpy.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Message-Id: <20211220084602.952091-1-wangborong@cdjrlc.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/platforms/iss/network.c