* [PATCH v2 net-next] net/sched: replace strncpy with strscpy
@ 2025-06-20 10:36 Pranav Tyagi
2025-06-20 19:59 ` Simon Horman
2025-06-24 0:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Pranav Tyagi @ 2025-06-20 10:36 UTC (permalink / raw)
To: jhs, xiyou.wangcong, jiri
Cc: davem, edumazet, kuba, pabeni, horms, netdev, linux-kernel, skhan,
linux-kernel-mentees, Pranav Tyagi
Replace the deprecated strncpy() with the two-argument version of
strscpy() as the destination is an array
and buffer should be NUL-terminated.
Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
---
net/sched/em_text.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/em_text.c b/net/sched/em_text.c
index 420c66203b17..6b3d0af72c39 100644
--- a/net/sched/em_text.c
+++ b/net/sched/em_text.c
@@ -108,7 +108,7 @@ static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m)
struct text_match *tm = EM_TEXT_PRIV(m);
struct tcf_em_text conf;
- strncpy(conf.algo, tm->config->ops->name, sizeof(conf.algo) - 1);
+ strscpy(conf.algo, tm->config->ops->name);
conf.from_offset = tm->from_offset;
conf.to_offset = tm->to_offset;
conf.from_layer = tm->from_layer;
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 net-next] net/sched: replace strncpy with strscpy
2025-06-20 10:36 [PATCH v2 net-next] net/sched: replace strncpy with strscpy Pranav Tyagi
@ 2025-06-20 19:59 ` Simon Horman
2025-06-24 0:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-06-20 19:59 UTC (permalink / raw)
To: Pranav Tyagi
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, skhan, linux-kernel-mentees
On Fri, Jun 20, 2025 at 04:06:53PM +0530, Pranav Tyagi wrote:
> Replace the deprecated strncpy() with the two-argument version of
> strscpy() as the destination is an array
> and buffer should be NUL-terminated.
>
> Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
Thanks for the update.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 net-next] net/sched: replace strncpy with strscpy
2025-06-20 10:36 [PATCH v2 net-next] net/sched: replace strncpy with strscpy Pranav Tyagi
2025-06-20 19:59 ` Simon Horman
@ 2025-06-24 0:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-24 0:10 UTC (permalink / raw)
To: Pranav Tyagi
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, horms,
netdev, linux-kernel, skhan, linux-kernel-mentees
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 20 Jun 2025 16:06:53 +0530 you wrote:
> Replace the deprecated strncpy() with the two-argument version of
> strscpy() as the destination is an array
> and buffer should be NUL-terminated.
>
> Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
> ---
> net/sched/em_text.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [v2,net-next] net/sched: replace strncpy with strscpy
https://git.kernel.org/netdev/net-next/c/b04202d6065c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-24 0:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 10:36 [PATCH v2 net-next] net/sched: replace strncpy with strscpy Pranav Tyagi
2025-06-20 19:59 ` Simon Horman
2025-06-24 0:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).