aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_ptp.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2024-07-14 04:11:15 +0000
committerJakub Kicinski <[email protected]>2024-07-16 14:52:15 +0000
commita3bfc095060b51f0198755020daf80d1e14413b1 (patch)
tree5e199f65a4dbd33599f45f1427312be2aa3369cd /drivers/net/ethernet/intel/ice/ice_ptp.c
parentwifi: ath12k: fix build vs old compiler (diff)
downloadkernel-a3bfc095060b51f0198755020daf80d1e14413b1.tar.gz
kernel-a3bfc095060b51f0198755020daf80d1e14413b1.zip
tcp: Replace strncpy() with strscpy()
Replace the deprecated[1] uses of strncpy() in tcp_ca_get_name_by_key() and tcp_get_default_congestion_control(). The callers use the results as standard C strings (via nla_put_string() and proc handlers respectively), so trailing padding is not needed. Since passing the destination buffer arguments decays it to a pointer, the size can't be trivially determined by the compiler. ca->name is the same length in both cases, so strscpy() won't fail (when ca->name is NUL-terminated). Include the length explicitly instead of using the 2-argument strscpy(). Link: https://github.com/KSPP/linux/issues/90 [1] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_ptp.c')
0 files changed, 0 insertions, 0 deletions