VirtualBox

Changeset 65529 in vbox for trunk


Ignore:
Timestamp:
Jan 31, 2017 8:00:40 AM (8 years ago)
Author:
vboxsync
Message:

USB: bugref:8752 Fix USBLibPurgeEncoding and always purge the device strings when creating a filter in userspace too to match what the driver presents to the filter manager

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/usblib.h

    r60241 r65529  
    124124 * @returns String length (excluding terminator).
    125125 * @param   psz                 The string to purge.
     126 *
     127 * @remarks The return string may be shorter than the input, left over space
     128 *          after the end of the string will be filled with zeros.
    126129 */
    127130DECLINLINE(size_t) USBLibPurgeEncoding(char *psz)
     
    156159                        break;
    157160                }
     161
     162                /* Wind back to the zero terminator and zero fill any gap to make
     163                   USBFilterValidate happy.  (offSrc is at zero terminator too.) */
     164                offDst--;
     165                while (offSrc > offDst)
     166                    psz[offSrc--] = '\0';
     167
    158168                return offDst;
    159169            }
  • trunk/src/VBox/Main/src-server/USBProxyBackend.cpp

    r65088 r65529  
    525525    {
    526526        vrc = USBFilterSetStringExact(aFilter, USBFILTERIDX_SERIAL_NUMBER_STR, pDev->pszSerialNumber,
    527                                       true /*fMustBePresent*/, false /*fPurge*/);
     527                                      true /*fMustBePresent*/, true /*fPurge*/);
    528528        AssertRC(vrc);
    529529    }
     
    531531    {
    532532        vrc = USBFilterSetStringExact(aFilter, USBFILTERIDX_PRODUCT_STR, pDev->pszProduct,
    533                                       true /*fMustBePresent*/, false /*fPurge*/);
     533                                      true /*fMustBePresent*/, true /*fPurge*/);
    534534        AssertRC(vrc);
    535535    }
     
    537537    {
    538538        vrc = USBFilterSetStringExact(aFilter, USBFILTERIDX_MANUFACTURER_STR, pDev->pszManufacturer,
    539                                       true /*fMustBePresent*/, false /*fPurge*/);
     539                                      true /*fMustBePresent*/, true /*fPurge*/);
    540540        AssertRC(vrc);
    541541    }
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