Re: [PATCH net-next v2] net: ipconfig: Replace strncpy with strscpy in ic_proto_name
From: patchwork-bot+netdevbpf
Date: Fri Nov 28 2025 - 23:33:22 EST
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:
On Wed, 26 Nov 2025 23:08:05 +0100 you wrote:
> strncpy() is deprecated [1] for NUL-terminated destination buffers
> because it does not guarantee NUL termination. Replace it with strscpy()
> to ensure the destination buffer is always NUL-terminated and to avoid
> any additional NUL padding.
>
> Although the identifier buffer has 252 usable bytes, strncpy() copied
> only up to 251 bytes to the zero-initialized buffer, relying on the last
> byte to act as an implicit NUL terminator. Switching to strscpy() avoids
> this implicit behavior and does not use magic numbers.
>
> [...]
Here is the summary with links:
- [net-next,v2] net: ipconfig: Replace strncpy with strscpy in ic_proto_name
https://git.kernel.org/netdev/net-next/c/ff736a286116
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html