Changeset 87119 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Dec 24, 2020 10:13:26 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/UsbMsd.cpp
r82968 r87119 887 887 { 888 888 /* Copy the CBW */ 889 size_t cbCopy = RT_UOFFSETOF_DYN(USBCBW, CBWCB[pCbw->bCBWCBLength]); 889 uint8_t bCBWLen = RT_MIN(pCbw->bCBWCBLength, sizeof(pCbw->CBWCB)); 890 size_t cbCopy = RT_UOFFSETOF_DYN(USBCBW, CBWCB[bCBWLen]); 890 891 memcpy(&pReq->Cbw, pCbw, cbCopy); 891 892 memset((uint8_t *)&pReq->Cbw + cbCopy, 0, sizeof(pReq->Cbw) - cbCopy); … … 1622 1623 return usbMsdCompleteStall(pThis, NULL, pUrb, "Bad CBW"); 1623 1624 } 1624 if ( pCbw->bCBWCBLength == 0)1625 if ((pCbw->bCBWCBLength == 0) || (pCbw->bCBWCBLength > sizeof(pCbw->CBWCB))) 1625 1626 { 1626 1627 Log(("usbMsd: CBW: Bad bCBWCBLength value: %#x\n", pCbw->bCBWCBLength));
Note:
See TracChangeset
for help on using the changeset viewer.