summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-07-22 20:21:52 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-07-23 00:26:35 +0000
commitcb92280ecad660fa3196f7addea6bd49b0147863 (patch)
treee6ac6e5c5de481c4d360b46b57c2413d0bb0b223 /firmware/usbstack
parent68294da574b29edb48904fb31a4a976a28040940 (diff)
downloadrockbox-cb92280ecad660fa3196f7addea6bd49b0147863.tar.gz
rockbox-cb92280ecad660fa3196f7addea6bd49b0147863.zip
usb_storage: Fix a memset in SCSI_INQUIRY that overflowed its buffer
The funny thing is that the memset() for the field in question was redundant, as the overall inquiry structure was memset(0) already. Change-Id: I8bec0c93c9317823ff39cf7133535e3bf58fb987
Diffstat (limited to 'firmware/usbstack')
-rw-r--r--firmware/usbstack/usb_storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index 39ccb9a6e5..8e1b507ac4 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -1245,7 +1245,7 @@ static void fill_inquiry(IF_MD_NONVOID(int lun))
tb.inquiry->DeviceType = DIRECT_ACCESS_DEVICE;
tb.inquiry->AdditionalLength = 0x1f;
- memset(tb.inquiry->Reserved, 0, 3);
+// memset(tb.inquiry->Reserved, 0, sizeof(tb.inquiry->Reserved)); // Redundant
tb.inquiry->Versions = 4; /* SPC-2 */
tb.inquiry->Format = 2; /* SPC-2/3 inquiry format */