VirtualBox

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


Ignore:
Timestamp:
Apr 30, 2010 9:19:04 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60938
Message:

DiskIntegrity: Fix memory corruption caused by the trace option. The index for the next free slot must be clipped always or we write beyond the array

File:
1 edited

Legend:

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

    r28902 r28948  
    405405
    406406    /* Search for the next one. */
    407     pThis->iNextFreeSlot++;
    408407    while (pThis->apReqActive[pThis->iNextFreeSlot].pIoReq)
    409         pThis->iNextFreeSlot = pThis->iNextFreeSlot++ % RT_ELEMENTS(pThis->apReqActive);
     408        pThis->iNextFreeSlot = (pThis->iNextFreeSlot+1) % RT_ELEMENTS(pThis->apReqActive);
    410409}
    411410
     
    526525                                             size_t cbRead, void *pvUser)
    527526{
    528      LogFlow(("%s: uOffset=%#llx paSeg=%#p cSeg=%u cbRead=%d\n pvUser=%#p", __FUNCTION__,
     527     LogFlow(("%s: uOffset=%#llx paSeg=%#p cSeg=%u cbRead=%d pvUser=%#p\n", __FUNCTION__,
    529528             uOffset, paSeg, cSeg, cbRead, pvUser));
    530529    PDRVDISKINTEGRITY pThis = PDMIMEDIAASYNC_2_DRVDISKINTEGRITY(pInterface);
     
    561560                                              size_t cbWrite, void *pvUser)
    562561{
    563      LogFlow(("%s: uOffset=%#llx paSeg=%#p cSeg=%u cbWrite=%d\n pvUser=%#p", __FUNCTION__,
     562     LogFlow(("%s: uOffset=%#llx paSeg=%#p cSeg=%u cbWrite=%d pvUser=%#p\n", __FUNCTION__,
    564563             uOffset, paSeg, cSeg, cbWrite, pvUser));
    565564    PDRVDISKINTEGRITY pThis = PDMIMEDIAASYNC_2_DRVDISKINTEGRITY(pInterface);
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