summaryrefslogtreecommitdiffstats
path: root/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:46 +0000
commit96647a898d62d699808316238dfb933d960413f2 (patch)
tree0138491ada40b7b3fcb80d4b219fa7922ae8f512 /src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
parentAdding debian version 7.0.14-dfsg-4. (diff)
downloadvirtualbox-96647a898d62d699808316238dfb933d960413f2.tar.xz
virtualbox-96647a898d62d699808316238dfb933d960413f2.zip
Merging upstream version 7.0.16-dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp')
-rw-r--r--src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp b/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
index b089f3c4..626f531d 100644
--- a/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
+++ b/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
@@ -2295,7 +2295,8 @@ static int lsilogicR3ProcessSCSIIORequest(PPDMDEVINS pDevIns, PLSILOGICSCSI pThi
{
PLSILOGICDEVICE pTgtDev = &pThisCC->paDeviceStates[pGuestReq->SCSIIO.u8TargetID];
- if (pTgtDev->pDrvBase)
+ if ( pTgtDev->pDrvBase
+ && pGuestReq->SCSIIO.u8CDBLength <= RT_ELEMENTS(pGuestReq->SCSIIO.au8CDB))
{
/* Allocate and prepare a new request. */
PDMMEDIAEXIOREQ hIoReq;
@@ -2364,12 +2365,12 @@ static int lsilogicR3ProcessSCSIIORequest(PPDMDEVINS pDevIns, PLSILOGICSCSI pThi
if (g_cLogged++ < MAX_REL_LOG_ERRORS)
{
- LogRel(("LsiLogic#%d: %d/%d (Bus/Target) doesn't exist\n", pDevIns->iInstance,
- pGuestReq->SCSIIO.u8TargetID, pGuestReq->SCSIIO.u8Bus));
+ LogRel(("LsiLogic#%d: %d/%d/%d (Bus/Target/CDBLength) doesn't exist\n", pDevIns->iInstance,
+ pGuestReq->SCSIIO.u8TargetID, pGuestReq->SCSIIO.u8Bus, pGuestReq->SCSIIO.u8CDBLength));
/* Log the CDB too */
LogRel(("LsiLogic#%d: Guest issued CDB {%#x",
pDevIns->iInstance, pGuestReq->SCSIIO.au8CDB[0]));
- for (unsigned i = 1; i < pGuestReq->SCSIIO.u8CDBLength; i++)
+ for (unsigned i = 1; i < RT_MIN(pGuestReq->SCSIIO.u8CDBLength, RT_ELEMENTS(pGuestReq->SCSIIO.au8CDB)); i++)
LogRel((", %#x", pGuestReq->SCSIIO.au8CDB[i]));
LogRel(("}\n"));
}