VirtualBox

Changeset 31363 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 4, 2010 4:10:22 PM (14 years ago)
Author:
vboxsync
Message:

Paranoia

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMSharedPage.cpp

    r30887 r31363  
    8989        PGMMREGISTERSHAREDMODULEREQ *ppSharedModule = NULL;
    9090
    91         if (pSharedModules[cSharedModules])
     91        if (    cSharedModules < RT_ELEMENTS(pSharedModules)
     92            &&  pSharedModules[cSharedModules])
    9293        {
    9394            for (unsigned i = 0; i < cSharedModules; i++)
     
    104105            ppSharedModule = &pSharedModules[cSharedModules];
    105106
    106         *ppSharedModule = (PGMMREGISTERSHAREDMODULEREQ)RTMemAllocZ(RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));
    107         memcpy(*ppSharedModule, pReq, RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));
    108         cSharedModules++;
     107        if (ppSharedModule)
     108        {
     109            *ppSharedModule = (PGMMREGISTERSHAREDMODULEREQ)RTMemAllocZ(RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));
     110            memcpy(*ppSharedModule, pReq, RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));
     111            cSharedModules++;
     112        }
    109113    }
    110114# endif
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