diff options
author | Kalle Valo <kvalo@kernel.org> | 2023-06-13 17:09:17 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2023-06-16 12:24:16 +0300 |
commit | 5ea0c313090046d84064dc556983d8ed7e6065dd (patch) | |
tree | 505afef65dfa8312d953edca8dc481a9407420d9 /drivers/net/wireless/intersil | |
parent | 4b6ec74ec476c775b44d49ecd8cd48334db8e798 (diff) | |
download | linux-5ea0c313090046d84064dc556983d8ed7e6065dd.tar.xz |
wifi: hostap: fix stringop-truncations GCC warning
With GCC 13.1 and W=1 hostap has a warning:
drivers/net/wireless/intersil/hostap/hostap_ioctl.c:3633:17: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
fortify-string.h recommends not to use strncpy() so use strscpy() which fixes
the warning. Also now it's guarenteed that the string is NUL-terminated.
Compile tested only.
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230613140918.389690-4-kvalo@kernel.org
Diffstat (limited to 'drivers/net/wireless/intersil')
-rw-r--r-- | drivers/net/wireless/intersil/hostap/hostap_ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/intersil/hostap/hostap_ioctl.c b/drivers/net/wireless/intersil/hostap/hostap_ioctl.c index 26287b129d18..b4adfc190ae8 100644 --- a/drivers/net/wireless/intersil/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/intersil/hostap/hostap_ioctl.c @@ -3630,7 +3630,7 @@ static int prism2_ioctl_get_encryption(local_info_t *local, param->u.crypt.key_len = 0; param->u.crypt.idx = 0xff; } else { - strncpy(param->u.crypt.alg, (*crypt)->ops->name, + strscpy(param->u.crypt.alg, (*crypt)->ops->name, HOSTAP_CRYPT_ALG_NAME_LEN); param->u.crypt.key_len = 0; |