diff mbox series

[v2,3/7] netfilter: nf_tables: refactor deprecated strncpy

Message ID 20230809-net-netfilter-v2-3-5847d707ec0a@google.com (mailing list archive)
State Mainlined
Commit 7457af8bf9948aeb31de21e4be3bc1fef2730958
Headers show
Series netfilter: refactor deprecated strncpy | expand

Commit Message

Justin Stitt Aug. 9, 2023, 1:06 a.m. UTC
Prefer `strscpy_pad` over `strncpy`.

Signed-off-by: Justin Stitt <justinstitt@google.com>
---
 net/netfilter/nft_fib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/netfilter/nft_fib.c b/net/netfilter/nft_fib.c
index 6e049fd48760..8c250a47a3b4 100644
--- a/net/netfilter/nft_fib.c
+++ b/net/netfilter/nft_fib.c
@@ -150,7 +150,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);