VirtualBox

Changeset 66505 in vbox for trunk/src


Ignore:
Timestamp:
Apr 11, 2017 9:31:25 AM (8 years ago)
Author:
vboxsync
Message:

Storage/VDI,VMDK: Allocate the correct amount of memory when probing

Location:
trunk/src/VBox/Storage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VDI.cpp

    r66486 r66505  
    13811381    AssertReturn((VALID_PTR(pszFilename) && *pszFilename), VERR_INVALID_PARAMETER);
    13821382
    1383     PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)RTMemAllocZ(sizeof(VDIIMAGEDESC));
     1383    PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)RTMemAllocZ(RT_UOFFSETOF(VDIIMAGEDESC, RegionList.aRegions[1]));
    13841384    if (RT_LIKELY(pImage))
    13851385    {
  • trunk/src/VBox/Storage/VMDK.cpp

    r66486 r66505  
    51865186
    51875187    int rc = VINF_SUCCESS;
    5188     PVMDKIMAGE pImage = (PVMDKIMAGE)RTMemAllocZ(sizeof(VMDKIMAGE));
     5188    PVMDKIMAGE pImage = (PVMDKIMAGE)RTMemAllocZ(RT_UOFFSETOF(VMDKIMAGE, RegionList.aRegions[1]));
    51895189    if (RT_LIKELY(pImage))
    51905190    {
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