VirtualBox

Changeset 75351 in vbox for trunk/src/VBox/Storage/VD.cpp


Ignore:
Timestamp:
Nov 9, 2018 10:46:06 AM (6 years ago)
Author:
vboxsync
Message:

Storage/VD: Fix error during merge if the target is bigger than the source image [fix]

File:
1 edited

Legend:

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

    r75349 r75351  
    70817081                         * bigger than the source.
    70827082                         */
    7083                         if (uOffset < pCurrImage->cbImage)
     7083                        uint64_t cbImage = vdImageGetSize(pCurrImage);
     7084                        if (uOffset < cbImage)
    70847085                        {
    7085                             cbThisRead = RT_MIN(cbThisRead, pCurrImage->cbImage - uOffset);
     7086                            cbThisRead = RT_MIN(cbThisRead, cbImage - uOffset);
    70867087                            rc = pCurrImage->Backend->pfnRead(pCurrImage->pBackendData,
    70877088                                                              uOffset, cbThisRead,
     
    72187219                     * bigger than the source.
    72197220                     */
    7220                     if (uOffset < pCurrImage->cbImage)
     7221                    uint64_t cbImage = vdImageGetSize(pCurrImage);
     7222                    if (uOffset < cbImage)
    72217223                    {
    7222                         cbThisRead = RT_MIN(cbThisRead, pCurrImage->cbImage - uOffset);
     7224                        cbThisRead = RT_MIN(cbThisRead, cbImage - uOffset);
    72237225                        rc = pCurrImage->Backend->pfnRead(pCurrImage->pBackendData,
    72247226                                                          uOffset, cbThisRead,
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