VirtualBox

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


Ignore:
Timestamp:
Jan 4, 2021 1:20:13 PM (4 years ago)
Author:
vboxsync
Message:

Devices/VBoxSCSI: Check against the correct limit, bugref:9897

File:
1 edited

Legend:

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

    r82968 r87165  
    426426    if (pVBoxSCSI->cbBufLeft > 0)
    427427    {
    428         Assert(cbTransfer <= pVBoxSCSI->cbBuf);
    429         if (cbTransfer > pVBoxSCSI->cbBuf)
    430         {
    431             memset(pbDst + pVBoxSCSI->cbBuf, 0xff, cbTransfer - pVBoxSCSI->cbBuf);
    432             cbTransfer = pVBoxSCSI->cbBuf;  /* Ignore excess data (not supposed to happen). */
     428        Assert(cbTransfer <= pVBoxSCSI->cbBufLeft);
     429        if (cbTransfer > pVBoxSCSI->cbBufLeft)
     430        {
     431            memset(pbDst + pVBoxSCSI->cbBuf, 0xff, cbTransfer - pVBoxSCSI->cbBufLeft);
     432            cbTransfer = pVBoxSCSI->cbBufLeft;  /* Ignore excess data (not supposed to happen). */
    433433        }
    434434
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