Thread (1 message) 1 message, 1 author, 2022-09-16

Re: [PATCH] carl9170: use strscpy() is more robust and safer

From: Kalle Valo <kvalo@kernel.org>
Date: 2022-09-16 08:49:01
Also in: linux-wireless, lkml

cgel.zte@gmail.com writes:
quoted hunk
From: Minghao Chi <redacted>

The implementation of strscpy() is more robust and safer.

That's now the recommended way to copy NUL terminated strings.

Reported-by: Zeal Robot <redacted>
Signed-off-by: Minghao Chi <redacted>
---
 drivers/net/wireless/ath/carl9170/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c
index 1ab09e1c9ec5..4c1aecd1163c 100644
--- a/drivers/net/wireless/ath/carl9170/fw.c
+++ b/drivers/net/wireless/ath/carl9170/fw.c
@@ -105,7 +105,7 @@ static void carl9170_fw_info(struct ar9170 *ar)
 			 CARL9170FW_GET_MONTH(fw_date),
 			 CARL9170FW_GET_DAY(fw_date));
 
-		strlcpy(ar->hw->wiphy->fw_version, motd_desc->release,
+		strscpy(ar->hw->wiphy->fw_version, motd_desc->release,
 			sizeof(ar->hw->wiphy->fw_version));
Already changed in:

https://git.kernel.org/netdev/net-next/c/bf99f11df4de

Please use latest trees to avoid duplicate work.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help