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>
Fri, 24 Dec 2021 10:59:48 +0000 (02:59 -0800)
commit56d55c151e0a9385c521766ed2fd580d7e9cb562
tree6ed53127b20b3106466ea3d5799d283d2f08d5e3
parenta7904a538933c525096ca2ccde1e60d0ee62c08e
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