VirtualBox

Changeset 18347 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Mar 26, 2009 7:23:37 PM (16 years ago)
Author:
vboxsync
Message:

Storage/VMDK: fix reading certain VMDK files which have unusual quoting. The specs really leave a lot to be desired.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r18331 r18347  
    13911391    while (*pszStr == ' ' || *pszStr == '\t')
    13921392        pszStr++;
    1393     if (*pszStr++ != '"')
    1394         return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename);
    1395 
    1396     pszQ = (char *)strchr(pszStr, '"');
    1397     if (pszQ == NULL)
    1398         return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename);
     1393
     1394    if (*pszStr != '"')
     1395    {
     1396        pszQ = (char *)pszStr;
     1397        while (*pszQ && *pszQ != ' ' && *pszQ != '\t')
     1398            pszQ++;
     1399    }
     1400    else
     1401    {
     1402        pszStr++;
     1403        pszQ = (char *)strchr(pszStr, '"');
     1404        if (pszQ == NULL)
     1405            return vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: incorrectly quoted value in descriptor in '%s'"), pImage->pszFilename);
     1406    }
     1407
    13991408    pszUnquoted = (char *)RTMemTmpAlloc(pszQ - pszStr + 1);
    14001409    if (!pszUnquoted)
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