linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m68k: apollo: replace strcpy() with strscpy()
@ 2025-05-14  5:23 Siddarth Gundu
  2025-05-14  7:10 ` Geert Uytterhoeven
  2025-05-20 11:38 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Siddarth Gundu @ 2025-05-14  5:23 UTC (permalink / raw)
  To: geert; +Cc: linux-m68k, linux-kernel, Siddarth Gundu

strcpy() is deprecated; use strscpy() instead.

strscpy was chosen because the code expects a NUL-terminated string
without zero-padding.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Siddarth Gundu <siddarthsgml@gmail.com>
---
 arch/m68k/apollo/config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index e161ecd76035..d4cc145e1611 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -7,6 +7,7 @@
 #include <linux/rtc.h>
 #include <linux/vt_kern.h>
 #include <linux/interrupt.h>
+#include <linux/string.h>
 
 #include <asm/setup.h>
 #include <asm/bootinfo.h>
@@ -218,7 +219,7 @@ static void dn_dummy_reset(void)
 
 static void dn_get_model(char *model)
 {
-    strcpy(model, "Apollo ");
+    strscpy(model, "Apollo ");
     if (apollo_model >= APOLLO_DN3000 && apollo_model <= APOLLO_DN4500)
         strcat(model, apollo_models[apollo_model - APOLLO_DN3000]);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-20 11:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14  5:23 [PATCH] m68k: apollo: replace strcpy() with strscpy() Siddarth Gundu
2025-05-14  7:10 ` Geert Uytterhoeven
2025-05-20 11:38 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).