From: Justin Stitt Date: Wed, 9 Aug 2023 01:06:05 +0000 (+0000) Subject: netfilter: nf_tables: refactor deprecated strncpy X-Git-Tag: v6.6.7~2079^2~47^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cdd75a4a66b7c9b2a2667d87619816d6e744d0e;p=platform%2Fkernel%2Flinux-starfive.git netfilter: nf_tables: refactor deprecated strncpy Prefer `strscpy_pad` over `strncpy`. Signed-off-by: Justin Stitt Signed-off-by: Florian Westphal --- diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index e87fd43..86bb9d7 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c @@ -108,7 +108,7 @@ static void nft_ct_get_eval(const struct nft_expr *expr, helper = rcu_dereference(help->helper); if (helper == NULL) goto err; - strncpy((char *)dest, helper->name, NF_CT_HELPER_NAME_LEN); + strscpy_pad((char *)dest, helper->name, NF_CT_HELPER_NAME_LEN); return; #ifdef CONFIG_NF_CONNTRACK_LABELS case NFT_CT_LABELS: {