[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250705135935.207198-1-miguelgarciaroman8@gmail.com>
Date: Sat, 5 Jul 2025 15:59:35 +0200
From: Miguel García <miguelgarciaroman8@...il.com>
To: sudipm.mukherjee@...il.com
Cc: linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org,
Miguel García <miguelgarciaroman8@...il.com>
Subject: [PATCH] parport: replace deprecated strcpy() with strscpy()
strcpy() is deprecated for NUL-terminated strings due to the risk of
buffer overflows. This replaces it with strscpy(), using the passed
'len' argument to limit the copy size safely.
Signed-off-by: Miguel García <miguelgarciaroman8@...il.com>
---
drivers/parport/probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parport/probe.c b/drivers/parport/probe.c
index 5d1b9aacb130..5f92f266bcb2 100644
--- a/drivers/parport/probe.c
+++ b/drivers/parport/probe.c
@@ -61,7 +61,7 @@ static void parse_data(struct parport *port, int device, char *str)
pr_warn("%s probe: memory squeeze\n", port->name);
return;
}
- strcpy(txt, str);
+ strscpy(txt, str, strlen(str) + 1);
while (p) {
char *sep;
q = strchr(p, ';');
--
2.34.1
Powered by blists - more mailing lists