Skip to content

Commit da6868d

Browse files
author
Mete Durlu
committed
net/smc: replace strncpy with strscpy
JIRA: https://issues.redhat.com/browse/RHEL-99989 commit ae2402b Author: Pranav Tyagi <pranav.tyagi03@gmail.com> Date: Fri Jun 20 15:55:59 2025 +0530 net/smc: replace strncpy with strscpy Replace the deprecated strncpy() with two-argument version of strscpy() as the destination is an array and 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/20250620102559.6365-1-pranav.tyagi03@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com> Signed-off-by: Mete Durlu <mdurlu@redhat.com>
1 parent e827af7 commit da6868d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/smc/smc_pnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,
370370
goto out_put;
371371
new_pe->type = SMC_PNET_ETH;
372372
memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN);
373-
strncpy(new_pe->eth_name, eth_name, IFNAMSIZ);
373+
strscpy(new_pe->eth_name, eth_name);
374374
rc = -EEXIST;
375375
new_netdev = true;
376376
mutex_lock(&pnettable->lock);

0 commit comments

Comments
 (0)