VirtualBox

Changeset 107724 in vbox


Ignore:
Timestamp:
Jan 13, 2025 8:20:36 PM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166826
Message:

Storage/VHD.cpp: Fix some harmless parfait warnings about possible integer overflows before assigning to a wider type, bugref:3409

File:
1 edited

Legend:

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

    r106061 r107724  
    15981598                    }
    15991599
    1600                     cbToRead = cSectors * VHD_SECTOR_SIZE;
     1600                    cbToRead = (size_t)cSectors * VHD_SECTOR_SIZE;
    16011601
    16021602                    LogFlowFunc(("uVhdOffset=%llu cbToRead=%u\n", uVhdOffset, cbToRead));
     
    16241624                    }
    16251625
    1626                     cbToRead = cSectors * VHD_SECTOR_SIZE;
     1626                    cbToRead = (size_t)cSectors * VHD_SECTOR_SIZE;
    16271627                    LogFunc(("Sectors free: uVhdOffset=%llu cbToRead=%u\n", uVhdOffset, cbToRead));
    16281628                    rc = VERR_VD_BLOCK_FREE;
     
    16911691                || (cbToWrite != pImage->cbDataBlock))
    16921692            {
    1693                 *pcbPreRead = cBATEntryIndex * VHD_SECTOR_SIZE;
     1693                *pcbPreRead = (size_t)cBATEntryIndex * VHD_SECTOR_SIZE;
    16941694                *pcbPostRead = pImage->cSectorsPerDataBlock * VHD_SECTOR_SIZE - cbToWrite - *pcbPreRead;
    16951695
Note: See TracChangeset for help on using the changeset viewer.

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