VirtualBox

Changeset 87166 in vbox


Ignore:
Timestamp:
Jan 4, 2021 1:23:10 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142086
Message:

Devices/DevBusLogic: Stricter check, bugref:9897

File:
1 edited

Legend:

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

    r87162 r87166  
    19851985            {
    19861986                /* First pass - set the number of following parameter bytes. */
    1987                 pThis->cbCommandParametersLeft = pThis->aCommandBuffer[0];
     1987                pThis->cbCommandParametersLeft = RT_MIN(pThis->aCommandBuffer[0], sizeof(pThis->aCommandBuffer) - 1);
    19881988                Log(("Set HA options: %u bytes follow\n", pThis->cbCommandParametersLeft));
    19891989            }
     
    20042004            {
    20052005                /* First pass - set the number of following CDB bytes. */
    2006                 pThis->cbCommandParametersLeft = pThis->aCommandBuffer[11];
     2006                pThis->cbCommandParametersLeft = RT_MIN(pThis->aCommandBuffer[11], sizeof(pThis->aCommandBuffer) - 12);
    20072007                Log(("Execute SCSI cmd: %u more bytes follow\n", pThis->cbCommandParametersLeft));
    20082008            }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette