Re: [PATCH 6/6] usbip: vhci_sysfs: Use safer strscpy() instead of strcpy()
From: Shuah Khan
Date: Tue Mar 10 2026 - 18:11:50 EST
On 3/10/26 03:44, Ai Chao wrote:
Use a safer function strscpy() instead of strcpy() for copying to
arrays.
Only idiomatic code replacement, and no functional changes.
It is a functional change since it calls a new routine. Get rid
of this line from change log.
How did you test this patch? I am curious because of you are
describing the change as "idiomatic code replacement"
Signed-off-by: Ai Chao <aichao@xxxxxxxxxx>
---
drivers/usb/usbip/vhci_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c
index bfc10f665e52..5bc8c47788d4 100644
--- a/drivers/usb/usbip/vhci_sysfs.c
+++ b/drivers/usb/usbip/vhci_sysfs.c
@@ -463,7 +463,7 @@ static void set_status_attr(int id)
status = status_attrs + id;
if (id == 0)
- strcpy(status->name, "status");
+ strscpy(status->name, "status");
else
snprintf(status->name, MAX_STATUS_NAME+1, "status.%d", id);
status->attr.attr.name = status->name;
thanks,
-- Shuah