VirtualBox

Changeset 40676 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 28, 2012 12:42:10 PM (13 years ago)
Author:
vboxsync
Message:

VBoxSCSI: Don't crash if a string I/O port access happens without a valid data buffer

File:
1 edited

Legend:

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

    r35346 r40676  
    346346    /* Read string only valid for data in register. */
    347347    AssertMsg(iRegister == 1, ("Hey only register 1 can be read from with string\n"));
    348     Assert(pVBoxSCSI->pBuf);
     348
     349    /* Accesses without a valid buffer will be ignored. */
     350    if (!pVBoxSCSI->pBuf)
     351        return VINF_SUCCESS;
    349352
    350353    int rc = PGMPhysSimpleDirtyWriteGCPtr(PDMDevHlpGetVMCPU(pDevIns), GCDst, pVBoxSCSI->pBuf, cbTransfer);
     
    375378    /* Write string only valid for data in/out register. */
    376379    AssertMsg(iRegister == 1, ("Hey only register 1 can be written to with string\n"));
     380
     381    /* Accesses without a valid buffer will be ignored. */
     382    if (!pVBoxSCSI->pBuf)
     383        return VINF_SUCCESS;
     384
    377385    Assert(cbTransfer == pVBoxSCSI->cbBuf);
    378386    if (cbTransfer > pVBoxSCSI->cbBuf)
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