VirtualBox

Changeset 29997 in vbox for trunk


Ignore:
Timestamp:
Jun 2, 2010 1:39:06 PM (15 years ago)
Author:
vboxsync
Message:

Main: add missing NULL ptr checks that can cause webservice to fail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestImpl.cpp

    r29867 r29997  
    269269        mMemoryBalloonSize = aMemoryBalloonSize;
    270270        /* forward the information to the VMM device */
    271         VMMDev *vmmDev = mParent->getVMMDev();
    272         if (vmmDev)
    273             vmmDev->getVMMDevPort()->pfnSetMemoryBalloon(vmmDev->getVMMDevPort(), aMemoryBalloonSize);
     271        VMMDev *pVMMDev = mParent->getVMMDev();
     272        if (pVMMDev)
     273        {
     274            PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
     275            ComAssertRet(pVMMDevPort, E_FAIL);
     276            pVMMDevPort->pfnSetMemoryBalloon(pVMMDevPort, aMemoryBalloonSize);
     277        }
    274278    }
    275279
     
    299303    mStatUpdateInterval = aUpdateInterval;
    300304    /* forward the information to the VMM device */
    301     VMMDev *vmmDev = mParent->getVMMDev();
    302     if (vmmDev)
    303         vmmDev->getVMMDevPort()->pfnSetStatisticsInterval(vmmDev->getVMMDevPort(), aUpdateInterval);
     305    VMMDev *pVMMDev = mParent->getVMMDev();
     306    if (pVMMDev)
     307    {
     308        PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
     309        ComAssertRet(pVMMDevPort, E_FAIL);
     310        pVMMDevPort->pfnSetStatisticsInterval(pVMMDevPort, aUpdateInterval);
     311    }
    304312
    305313    return S_OK;
     
    393401
    394402    /* forward the information to the VMM device */
    395     VMMDev *vmmDev = mParent->getVMMDev();
    396     if (vmmDev)
    397     {
     403    VMMDev *pVMMDev = mParent->getVMMDev();
     404    if (pVMMDev)
     405    {
     406        PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
     407        ComAssertRet(pVMMDevPort, E_FAIL);
     408
    398409        uint32_t u32Flags = VMMDEV_SETCREDENTIALS_GUESTLOGON;
    399410        if (!aAllowInteractiveLogon)
    400411            u32Flags = VMMDEV_SETCREDENTIALS_NOLOCALLOGON;
    401412
    402         vmmDev->getVMMDevPort()->pfnSetCredentials(vmmDev->getVMMDevPort(),
     413        pVMMDevPort->pfnSetCredentials(pVMMDevPort,
    403414            Utf8Str(aUserName).raw(), Utf8Str(aPassword).raw(),
    404415            Utf8Str(aDomain).raw(), u32Flags);
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