VirtualBox

Changeset 106241 in vbox


Ignore:
Timestamp:
Oct 8, 2024 3:20:56 PM (7 weeks ago)
Author:
vboxsync
Message:

DrvSCSI: When completing SCSI commands, copy only the amount of data provided by device rather than entire buffer size (see bugref:10774).

File:
1 edited

Legend:

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

    r106061 r106241  
    10371037
    10381038    /* Sync buffers. */
     1039    size_t cbCopyIn = RT_MIN(pReq->cbBuf, cbXfer);
    10391040    if (   RT_SUCCESS(rcReq)
    1040         && pReq->cbBuf
     1041        && cbCopyIn
    10411042        && (   pReq->enmXferDir == PDMMEDIAEXIOREQSCSITXDIR_UNKNOWN
    10421043            || pReq->enmXferDir == PDMMEDIAEXIOREQSCSITXDIR_FROM_DEVICE))
     
    10451046        RTSgBufInit(&SgBuf, &pReq->Seg, 1);
    10461047        int rcCopy = pThis->pDevMediaExPort->pfnIoReqCopyFromBuf(pThis->pDevMediaExPort, (PDMMEDIAEXIOREQ)pReq,
    1047                                                                  &pReq->abAlloc[0], 0, &SgBuf, pReq->cbBuf);
     1048                                                                 &pReq->abAlloc[0], 0, &SgBuf, cbCopyIn);
    10481049        if (RT_FAILURE(rcCopy))
    10491050            rcReq = rcCopy;
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