From: Pranav Tyagi Date: Fri, 20 Jun 2025 10:36:53 +0000 (+0530) Subject: net/sched: replace strncpy with strscpy X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b04202d6065cba5dfd51fb9866400b25573eac67;p=thirdparty%2Fkernel%2Flinux.git net/sched: replace strncpy with strscpy 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 Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250620103653.6957-1-pranav.tyagi03@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/net/sched/em_text.c b/net/sched/em_text.c index 420c66203b177..6b3d0af72c39c 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;