summaryrefslogtreecommitdiff
path: root/lib/rt-thread
diff options
context:
space:
mode:
authorOld-Ding <[email protected]>2026-06-28 15:40:08 +0800
committerOld-Ding <[email protected]>2026-06-28 15:40:08 +0800
commita9e64ee3a4ed4d750a167d341d1481b984c41849 (patch)
tree753b25aeb256e1bef4f70c9ae47ac3e5d4a1565a /lib/rt-thread
parentca8a74fa93a597e81ebd869c351f8a3529e01aba (diff)
Fix RT-Thread MSC inquiry string bounds
Diffstat (limited to 'lib/rt-thread')
-rw-r--r--lib/rt-thread/port/msc_device_port.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rt-thread/port/msc_device_port.c b/lib/rt-thread/port/msc_device_port.c
index c7e8c508e..d981759c4 100644
--- a/lib/rt-thread/port/msc_device_port.c
+++ b/lib/rt-thread/port/msc_device_port.c
@@ -49,9 +49,9 @@ void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16
const char pid[] = PKG_TINYUSB_DEVICE_MSC_PID;
const char rev[] = PKG_TINYUSB_DEVICE_MSC_REV;
- memcpy(vendor_id, vid, strlen(vid));
- memcpy(product_id, pid, strlen(pid));
- memcpy(product_rev, rev, strlen(rev));
+ strncpy((char*) vendor_id, vid, 8);
+ strncpy((char*) product_id, pid, 16);
+ strncpy((char*) product_rev, rev, 4);
}
bool tud_msc_test_unit_ready_cb(uint8_t lun)