diff options
author | Pranav Tyagi <pranav.tyagi03@gmail.com> | 2025-06-20 16:06:53 +0530 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-23 16:56:51 -0700 |
commit | b04202d6065cba5dfd51fb9866400b25573eac67 (patch) | |
tree | fb3c0ecf71a1f4b7129aea08d7b88edc08a27123 /net/sched/em_text.c | |
parent | ae2402bf882b40fb9cf3b6a5c9ff0e6c7a9ef842 (diff) |
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>
Diffstat (limited to 'net/sched/em_text.c')
-rw-r--r-- | net/sched/em_text.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |