Commit b04202d6 authored by Pranav Tyagi's avatar Pranav Tyagi Committed by Jakub Kicinski
Browse files

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: default avatarPranav Tyagi <pranav.tyagi03@gmail.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250620103653.6957-1-pranav.tyagi03@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ae2402bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;