mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 05:42:46 +01:00
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
ae2402bf88
commit
b04202d606
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user