Re: [PATCH] net: qcom/emac: Replace strlcpy with strscpy

From
patchwork-bot+netdevbpf@kernel.org
Date
2021-09-06 15:50:09
Also in
lkml
Reply to
Jason Wang, 2021-09-06
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon,  6 Sep 2021 21:56:53 +0800 you wrote:
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.

[...]
Here is the summary with links:
  - net: qcom/emac: Replace strlcpy with strscpy
    https://git.kernel.org/netdev/net/c/0a83299935f0

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Thread (2 messages) 2 messages, 2 authors, last reply 2021-09-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help