netfilter: nf_tables: refactor deprecated strncpy

Prefer `strscpy_pad` over `strncpy`.

Signed-off-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
Justin Stitt 2023-08-09 01:06:06 +00:00 committed by Florian Westphal
parent 6cdd75a4a6
commit 7457af8bf9
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ void nft_fib_store_result(void *reg, const struct nft_fib *priv,
if (priv->flags & NFTA_FIB_F_PRESENT)
*dreg = !!dev;
else
strncpy(reg, dev ? dev->name : "", IFNAMSIZ);
strscpy_pad(reg, dev ? dev->name : "", IFNAMSIZ);
break;
default:
WARN_ON_ONCE(1);