VirtualBox

Ignore:
Timestamp:
Jun 4, 2015 9:46:36 AM (10 years ago)
Author:
vboxsync
Message:

VBoxUSB/win: Fix possible endless loop when bLength is 0 (seen sometimes when a TerraTec Aureon USB soundcard is in a strange state), remove assertion which almost always triggers here with a debug build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp

    r56073 r56238  
    663663    int rc = usbLibDevStrDrEntryGet(hHub, iPort, 0, 0, ppList);
    664664    if (RT_FAILURE(rc))
    665     {
    666         AssertRC(rc);
    667665        return rc;
    668     }
    669 
    670     PUSB_STRING_DESCRIPTOR pLandStrDr = &(*ppList)->StrDr;
    671     USHORT *pIdLang = pLandStrDr->bString;
    672     ULONG cIdLang = (pLandStrDr->bLength - RT_OFFSETOF(USB_STRING_DESCRIPTOR, bString)) / sizeof (*pIdLang);
     666
     667    PUSB_STRING_DESCRIPTOR pLangStrDr = &(*ppList)->StrDr;
     668    USHORT *pIdLang = pLangStrDr->bString;
     669    ULONG cIdLang = (pLangStrDr->bLength - RT_OFFSETOF(USB_STRING_DESCRIPTOR, bString)) / sizeof (*pIdLang);
    673670
    674671    if (pDevDr->iManufacturer)
     
    700697            break;
    701698        }
     699
     700        /* This is invalid but was seen with a TerraTec Aureon 7.1 USB sound card. */
     701        if (!pCmnDr->bLength)
     702            break;
    702703
    703704        switch (pCmnDr->bDescriptorType)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette