* [PATCH] w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
@ 2025-10-09 17:45 Thorsten Blum
2025-10-13 0:19 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-10-09 17:45 UTC (permalink / raw)
To: Krzysztof Kozlowski, zhangheng
Cc: linux-hardening, Thorsten Blum, Krzysztof Kozlowski, linux-kernel
strcpy() is deprecated and using strcat() is discouraged. Replace them with
scnprintf(). No functional changes.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/w1/slaves/w1_ds28e17.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds28e17.c b/drivers/w1/slaves/w1_ds28e17.c
index 5738cbce1a37..e53bc41bde3c 100644
--- a/drivers/w1/slaves/w1_ds28e17.c
+++ b/drivers/w1/slaves/w1_ds28e17.c
@@ -719,8 +719,8 @@ static int w1_f19_add_slave(struct w1_slave *sl)
data->adapter.owner = THIS_MODULE;
data->adapter.algo = &w1_f19_i2c_algorithm;
data->adapter.algo_data = sl;
- strcpy(data->adapter.name, "w1-");
- strcat(data->adapter.name, sl->name);
+ scnprintf(data->adapter.name, sizeof(data->adapter.name), "w1-%s",
+ sl->name);
data->adapter.dev.parent = &sl->dev;
data->adapter.quirks = &w1_f19_i2c_adapter_quirks;
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
2025-10-09 17:45 [PATCH] w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave Thorsten Blum
@ 2025-10-13 0:19 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-13 0:19 UTC (permalink / raw)
To: Krzysztof Kozlowski, zhangheng, Thorsten Blum
Cc: linux-hardening, linux-kernel
On Thu, 09 Oct 2025 19:45:12 +0200, Thorsten Blum wrote:
> strcpy() is deprecated and using strcat() is discouraged. Replace them with
> scnprintf(). No functional changes.
>
>
Applied, thanks!
[1/1] w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
https://git.kernel.org/krzk/linux-w1/c/f3c6353d801a9826e234ad477af08b09a98d888b
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-13 0:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 17:45 [PATCH] w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave Thorsten Blum
2025-10-13 0:19 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox