Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Pranav Tyagi and committed by
Jakub Kicinski
ae2402bf bf92ffb0

+1 -1
+1 -1
net/smc/smc_pnet.c
··· 370 370 goto out_put; 371 371 new_pe->type = SMC_PNET_ETH; 372 372 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); 374 374 rc = -EEXIST; 375 375 new_netdev = true; 376 376 mutex_lock(&pnettable->lock);