Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@gmail.com>
Link: https://lore.kernel.org/r/20231023090001.7273-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Michael Straube and committed by
Greg Kroah-Hartman
e26511f6 5e3441eb

+1 -1
+1 -1
drivers/staging/vme_user/vme_tsi148.c
··· 2310 2310 mutex_init(&tsi148_device->vme_rmw); 2311 2311 2312 2312 tsi148_bridge->parent = &pdev->dev; 2313 - strcpy(tsi148_bridge->name, driver_name); 2313 + strscpy(tsi148_bridge->name, driver_name, VMENAMSIZ); 2314 2314 2315 2315 /* Setup IRQ */ 2316 2316 retval = tsi148_irq_init(tsi148_bridge);