Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <pranav.tyagi03@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250620103653.6957-1-pranav.tyagi03@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Pranav Tyagi and committed by
Jakub Kicinski
b04202d6 ae2402bf

+1 -1
+1 -1
net/sched/em_text.c
··· 108 108 struct text_match *tm = EM_TEXT_PRIV(m); 109 109 struct tcf_em_text conf; 110 110 111 - strncpy(conf.algo, tm->config->ops->name, sizeof(conf.algo) - 1); 111 + strscpy(conf.algo, tm->config->ops->name); 112 112 conf.from_offset = tm->from_offset; 113 113 conf.to_offset = tm->to_offset; 114 114 conf.from_layer = tm->from_layer;