1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/ath/ath6kl
Justin Stitt 40990961d9 wifi: ath6kl: replace deprecated strncpy with memcpy
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous
interfaces.

The affected code's purpose is to truncate strings that are too long
with "..." like:
foobar -> fo...

The lengths have been carefully calculated and as such this has decayed
to a simple byte copy from one buffer to another -- let's use memcpy().

Note: build-tested only.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20231013-strncpy-drivers-net-wireless-ath-ath6kl-init-c-v1-1-d69c599b49a9@google.com
2023-10-18 11:32:36 +03:00
..
bmi.c wifi: ath6kl: minor fix for allocation size 2023-02-17 18:03:04 +02:00
bmi.h
cfg80211.c wifi: cfg80211: split struct cfg80211_ap_settings 2023-09-25 09:00:39 +02:00
cfg80211.h cfg80211: pass name_assign_type to rdev_add_virtual_intf() 2015-03-30 10:36:17 +02:00
common.h ath6kl: add ath6kl_ prefix to crypto_type 2018-12-13 09:58:52 +01:00
core.c cfg80211: avoid holding the RTNL when calling the driver 2021-01-26 11:55:50 +01:00
core.h ath6kl: Replace zero-length array with flexible-array 2020-05-06 09:21:30 +03:00
debug.c wifi: ath6kl: Remove error checking for debugfs_create_dir() 2023-07-25 17:30:54 +03:00
debug.h ath6kl: add __printf verification to ath6kl_dbg 2017-04-13 15:43:39 +03:00
hif-ops.h
hif.c ath6kl: enable firmware crash dumps on the AR6004 2016-09-09 15:12:59 +03:00
hif.h wifi: ath6kl: fix repeated words in comments 2022-07-18 13:04:32 +03:00
htc-ops.h
htc.h ath6kl: Use struct_group() to avoid size-mismatched casting 2021-12-09 10:00:12 +02:00
htc_mbox.c ath6kl: fix typos in comments 2022-03-18 17:38:45 +02:00
htc_pipe.c wifi: ath6kl: reduce WARN to dev_dbg() in callback 2023-02-27 14:19:35 +02:00
init.c wifi: ath6kl: replace deprecated strncpy with memcpy 2023-10-18 11:32:36 +03:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
main.c wifi: ath6kl: remove unnecessary (void*) conversions 2023-09-21 11:08:22 +03:00
Makefile Revert "wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12" 2023-07-26 10:09:28 +03:00
recovery.c timer: Remove init_timer_deferrable() in favor of timer_setup() 2017-10-05 15:01:18 +02:00
sdio.c wifi: ath6kl: fix repeated words in comments 2022-07-18 13:04:32 +03:00
target.h
testmode.c wireless: remove unneeded break 2020-11-07 13:34:22 +02:00
testmode.h
trace.c
trace.h tracing/ath: Use the new __vstring() helper 2022-07-15 17:44:40 -04:00
txrx.c wifi: ath6kl: remove unnecessary (void*) conversions 2023-09-21 11:08:22 +03:00
usb.c ath6kl: avoid flush_scheduled_work() usage 2022-06-20 13:04:49 +03:00
wmi.c ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_aplist_event 2022-03-09 17:07:44 +02:00
wmi.h wifi: ath6kl: fix repeated words in comments 2022-07-18 13:04:32 +03:00