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

Configure Feed

Select the types of activity you want to include in your feed.

usbip: vhci_sysfs: Use safer strscpy() instead of strcpy()

Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
Link: https://patch.msgid.link/20260310094434.3639602-7-aichao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ai Chao and committed by
Greg Kroah-Hartman
8f196a35 9b4051a4

+1 -1
+1 -1
drivers/usb/usbip/vhci_sysfs.c
··· 463 463 464 464 status = status_attrs + id; 465 465 if (id == 0) 466 - strcpy(status->name, "status"); 466 + strscpy(status->name, "status"); 467 467 else 468 468 snprintf(status->name, MAX_STATUS_NAME+1, "status.%d", id); 469 469 status->attr.attr.name = status->name;