VirtualBox

Changeset 102827 in vbox for trunk/src


Ignore:
Timestamp:
Jan 10, 2024 8:24:37 PM (13 months ago)
Author:
vboxsync
Message:

Devices/VirtioCore, Devices/VirtioNet: Correct check, bugref:10566

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r101400 r102827  
    28072807                    uint64_t srcSgCur   = (uint64_t)pSgPhysSend->GCPhysCur;
    28082808                    cbCopied = RT_MIN((uint64_t)cbRemain, srcSgLen - (srcSgCur - srcSgStart));
     2809                    /*
     2810                     * Guest sent a bogus S/G chain, there doesn't seem to be a way to report an error but
     2811                     * as this shouldn't happen anyway we just stop proccessing this chain.
     2812                     */
     2813                    if (RT_UNLIKELY(!cbCopied))
     2814                        break;
    28092815                    virtioCoreGCPhysRead(pVirtio, pDevIns,
    28102816                                         (RTGCPHYS)pSgPhysSend->GCPhysCur,
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp

    r100402 r102827  
    985985        {
    986986            cbCopy = RT_MIN(pSgVirtReturn->cbSegLeft,  pSgPhysReturn->cbSegLeft);
    987             Assert(cbCopy > 0);
     987            AssertReturn(cbCopy > 0, VERR_INVALID_PARAMETER);
    988988            virtioCoreGCPhysWrite(pVirtio, pDevIns, (RTGCPHYS)pSgPhysReturn->GCPhysCur, pSgVirtReturn->pvSegCur, cbCopy);
    989989            RTSgBufAdvance(pSgVirtReturn, cbCopy);
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