[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20231023090001.7273-1-straube.linux@gmail.com>
Date: Mon, 23 Oct 2023 11:00:01 +0200
From: Michael Straube <straube.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: martyn@...chs.me.uk, manohar.vanga@...il.com,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Michael Straube <straube.linux@...il.com>
Subject: [PATCH] staging: vme_user: prefer strscpy over strcpy
Using strcpy has potential for buffer overflows. It should be replaced
with strscpy where possible. In this case the return value of strcpy is
not used, so we can safely replace it with strscpy.
Signed-off-by: Michael Straube <straube.linux@...il.com>
---
Compile tested only.
drivers/staging/vme_user/vme_tsi148.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c
index d549c22da534..2ec9c2904404 100644
--- a/drivers/staging/vme_user/vme_tsi148.c
+++ b/drivers/staging/vme_user/vme_tsi148.c
@@ -2310,7 +2310,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
mutex_init(&tsi148_device->vme_rmw);
tsi148_bridge->parent = &pdev->dev;
- strcpy(tsi148_bridge->name, driver_name);
+ strscpy(tsi148_bridge->name, driver_name, VMENAMSIZ);
/* Setup IRQ */
retval = tsi148_irq_init(tsi148_bridge);
--
2.42.0
Powered by blists - more mailing lists