VirtualBox

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


Ignore:
Timestamp:
Jul 12, 2018 1:51:05 PM (6 years ago)
Author:
vboxsync
Message:

lsilogicR3LoadExec: Should check SSMR3GetXxxx return values before using the data. Removed unnecessary variable initialization as it totally messes with my head.

File:
1 edited

Legend:

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

    r71775 r73091  
    48524852        if (uVersion > LSILOGIC_SAVED_STATE_VERSION_PRE_DIAG_MEM)
    48534853        {
     4854
     4855            /* Save diagnostic memory register and data regions. */
     4856            SSMR3GetU32(pSSM, &pThis->u32DiagMemAddr);
    48544857            uint32_t cMemRegions = 0;
    4855 
    4856             /* Save diagnostic memory register and data regions. */
    4857             SSMR3GetU32   (pSSM, &pThis->u32DiagMemAddr);
    4858             SSMR3GetU32   (pSSM, &cMemRegions);
     4858            rc = SSMR3GetU32(pSSM, &cMemRegions);
     4859            AssertLogRelReturn(rc, rc);
    48594860
    48604861            while (cMemRegions)
    48614862            {
    48624863                uint32_t u32AddrStart = 0;
     4864                SSMR3GetU32(pSSM, &u32AddrStart);
    48634865                uint32_t u32AddrEnd = 0;
    4864                 uint32_t cRegion = 0;
    4865                 PLSILOGICMEMREGN pRegion = NULL;
    4866 
    4867                 SSMR3GetU32(pSSM, &u32AddrStart);
    4868                 SSMR3GetU32(pSSM, &u32AddrEnd);
    4869 
    4870                 cRegion = u32AddrEnd - u32AddrStart + 1;
    4871                 pRegion = (PLSILOGICMEMREGN)RTMemAllocZ(RT_OFFSETOF(LSILOGICMEMREGN, au32Data[cRegion]));
     4866                rc = SSMR3GetU32(pSSM, &u32AddrEnd);
     4867                AssertLogRelReturn(rc, rc);
     4868
     4869                uint32_t         cRegion = u32AddrEnd - u32AddrStart + 1;
     4870                PLSILOGICMEMREGN pRegion = (PLSILOGICMEMREGN)RTMemAllocZ(RT_OFFSETOF(LSILOGICMEMREGN, au32Data[cRegion]));
    48724871                if (pRegion)
    48734872                {
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