Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] Input: mouse: vsxxxaa: Replace strlcat() with strscpy()
@ 2026-11-04  6:23 Mariia Nikitash
  2026-11-04 11:21 ` Alejandro Colomar
  2026-11-04 16:33 ` Shihuang Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Mariia Nikitash @ 2026-11-04  6:23 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, linux-kernel, linux-hardening, kees, justinstitt,
	morbo, Mariia Nikitash

In preparation for removing the deprecated strlcat() API[1], use
strscpy() to initialize the mouse device name.

The destination is zero-initialized, and the constant string fits
within the buffer. Since the return value is unused, this preserves
the existing behavior.

Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Mariia Nikitash <nikitash.mariiaw@gmail.com>
---
 drivers/input/mouse/vsxxxaa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index 042a17fe81db..b3a0d7ff5738 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -463,8 +463,8 @@ static int vsxxxaa_connect(struct serio *serio, struct serio_driver *drv)
 
 	mouse->dev = input_dev;
 	mouse->serio = serio;
-	strlcat(mouse->name, "DEC VSXXX-AA/-GA mouse or VSXXX-AB digitizer",
-		 sizeof(mouse->name));
+	strscpy(mouse->name, "DEC VSXXX-AA/-GA mouse or VSXXX-AB digitizer",
+		sizeof(mouse->name));
 	snprintf(mouse->phys, sizeof(mouse->phys), "%s/input0", serio->phys);
 
 	input_dev->name = mouse->name;
-- 
2.43.0


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

end of thread, other threads:[~2026-11-04 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  6:23 [PATCH] Input: mouse: vsxxxaa: Replace strlcat() with strscpy() Mariia Nikitash
2026-11-04 11:21 ` Alejandro Colomar
2026-11-04 16:33 ` Shihuang Liu

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