From cb92280ecad660fa3196f7addea6bd49b0147863 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 22 Jul 2021 20:21:52 -0400 Subject: [PATCH] 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 --- firmware/usbstack/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */