public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy
@ 2025-09-15 20:06 Miquel Sabaté Solà
  2025-09-16  9:10 ` kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Miquel Sabaté Solà @ 2025-09-15 20:06 UTC (permalink / raw)
  To: linux-riscv
  Cc: linux-kernel, pjw, palmer, alex, wangyuli, chenhuacai, mikisabate

As pointed out in [1], strcpy() is deprecated in favor of strscpy().

[1] KSPP#88

Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
---
 arch/riscv/kernel/kgdb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/kgdb.c b/arch/riscv/kernel/kgdb.c
index 9f3db3503dab..945f82a72954 100644
--- a/arch/riscv/kernel/kgdb.c
+++ b/arch/riscv/kernel/kgdb.c
@@ -265,10 +265,10 @@ void kgdb_arch_handle_qxfer_pkt(char *remcom_in_buffer,
 {
 	if (!strncmp(remcom_in_buffer, gdb_xfer_read_target,
 		     sizeof(gdb_xfer_read_target)))
-		strcpy(remcom_out_buffer, riscv_gdb_stub_target_desc);
+		strscpy(remcom_out_buffer, riscv_gdb_stub_target_desc);
 	else if (!strncmp(remcom_in_buffer, gdb_xfer_read_cpuxml,
 			  sizeof(gdb_xfer_read_cpuxml)))
-		strcpy(remcom_out_buffer, riscv_gdb_stub_cpuxml);
+		strscpy(remcom_out_buffer, riscv_gdb_stub_cpuxml);
 }
 
 static inline void kgdb_arch_update_addr(struct pt_regs *regs,
-- 
2.51.0


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

end of thread, other threads:[~2025-09-16 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-15 20:06 [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy Miquel Sabaté Solà
2025-09-16  9:10 ` kernel test robot
2025-09-16 12:39   ` Miquel Sabaté Solà

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox