summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2026-07-03 11:25:33 +0200
committerGitHub <[email protected]>2026-07-03 11:25:33 +0200
commitef051846357b79e1d8c27d9643b1ee9c950dfda0 (patch)
tree16c5d78ba0064c7c16b162076b23465fc0f12c54 /lib
parent3157621ee67b486aecf887ca88851a20a9bb1447 (diff)
parenta9e64ee3a4ed4d750a167d341d1481b984c41849 (diff)
Merge pull request #3742 from Old-Ding/fix/rtthread-msc-inquiry-bounds
Fix RT-Thread MSC inquiry string bounds
Diffstat (limited to 'lib')
-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)