Changeset 83617 in vbox for trunk/src/VBox
- Timestamp:
- Apr 8, 2020 9:21:02 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r82968 r83617 380 380 RT_NOREF(pszTag); 381 381 PVUSBURBPOOL pUrbPool = &pRh->Hub.Dev.UrbPool; 382 383 if (RT_UNLIKELY(cbData > (32 * _1M))) 384 { 385 LogFunc(("Bad URB size (%u)!\n", cbData)); 386 return NULL; 387 } 382 388 383 389 if (!pDev) -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r83592 r83617 703 703 if (pExtra->cbMax < cbBuf + pSetupIn->wLength + sizeof(VUSBURBVUSBINT)) 704 704 { 705 #if 1 706 LogRelMax(10, ("VUSB: Control URB too large (wLength=%u)!\n", pSetupIn->wLength)); 707 return false; 708 #else 705 709 uint32_t cbReq = RT_ALIGN_32(cbBuf + pSetupIn->wLength + sizeof(VUSBURBVUSBINT), 1024); 706 710 PVUSBCTRLEXTRA pNew = (PVUSBCTRLEXTRA)RTMemRealloc(pExtra, RT_UOFFSETOF_DYN(VUSBCTRLEXTRA, Urb.abData[cbReq])); … … 717 721 pPipe->pCtrl = pExtra; 718 722 } 723 724 PVUSBURBVUSB pOldVUsb = (PVUSBURBVUSB)&pExtra->Urb.abData[pExtra->cbMax - sizeof(VUSBURBVUSBINT)]; 719 725 pExtra->Urb.pVUsb = (PVUSBURBVUSB)&pExtra->Urb.abData[cbBuf + pSetupIn->wLength]; 726 memmove(pExtra->Urb.pVUsb, pOldVUsb, sizeof(VUSBURBVUSBINT)); 727 memset(pOldVUsb, 0, (uint8_t *)pExtra->Urb.pVUsb - (uint8_t *)pOldVUsb); 720 728 pExtra->Urb.pVUsb->pUrb = &pExtra->Urb; 729 pExtra->Urb.pVUsb->pvFreeCtx = &pExtra->Urb; 721 730 pExtra->cbMax = cbReq; 731 732 #endif 722 733 } 723 734 Assert(pExtra->Urb.enmState == VUSBURBSTATE_ALLOCATED);
Note:
See TracChangeset
for help on using the changeset viewer.