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 use of strncpy on NUL-terminated string with strscpy

strncpy is deprecated for use on NUL-terminated strings, as indicated in
Documentation/process/deprecated.rst. strncpy NUL-pads the destination
buffer and doesn't guarantee the destination buffer will be NUL
terminated.

Signed-off-by: James Flowers <bold.zone2373@fastmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
Link: https://patch.msgid.link/20250901030512.80099-1-bold.zone2373@fastmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

James Flowers and committed by
Jakub Kicinski
d250f14f 99502c61

+1 -1
+1 -1
net/smc/smc_pnet.c
··· 450 450 return -ENOMEM; 451 451 new_pe->type = SMC_PNET_IB; 452 452 memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN); 453 - strncpy(new_pe->ib_name, ib_name, IB_DEVICE_NAME_MAX); 453 + strscpy(new_pe->ib_name, ib_name); 454 454 new_pe->ib_port = ib_port; 455 455 456 456 new_ibdev = true;