linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Siddarth Gundu <siddarthsgml@gmail.com>
To: geert@linux-m68k.org
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	Siddarth Gundu <siddarthsgml@gmail.com>
Subject: [PATCH] m68k: apollo: replace strcpy() with strscpy()
Date: Wed, 14 May 2025 10:53:27 +0530	[thread overview]
Message-ID: <20250514052327.96537-1-siddarthsgml@gmail.com> (raw)

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


             reply	other threads:[~2025-05-14  5:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14  5:23 Siddarth Gundu [this message]
2025-05-14  7:10 ` [PATCH] m68k: apollo: replace strcpy() with strscpy() Geert Uytterhoeven
2025-05-20 11:38 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250514052327.96537-1-siddarthsgml@gmail.com \
    --to=siddarthsgml@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).