VirtualBox

Changeset 17350 in vbox


Ignore:
Timestamp:
Mar 4, 2009 3:54:40 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43739
Message:

Main/GuestProperties: the session machine directControl pointer can be NULL, check this

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Main/MachineImpl.cpp

    r17182 r17350  
    30103010        alock.unlock();
    30113011
    3012         rc = directControl->AccessGuestProperty (aName, NULL, NULL,
    3013                                                  false /* isSetter */,
    3014                                                  aValue, aTimestamp, aFlags);
     3012        /* fail if we were called after #OnSessionEnd() is called.  This is a
     3013         * silly race condition. */
     3014
     3015        if (!directControl)
     3016            rc = E_FAIL;
     3017        else
     3018            rc = directControl->AccessGuestProperty (aName, NULL, NULL,
     3019                                                     false /* isSetter */,
     3020                                                     aValue, aTimestamp, aFlags);
    30153021    }
    30163022    return rc;
     
    31483154        BSTR dummy = NULL;
    31493155        ULONG64 dummy64;
    3150         rc = directControl->AccessGuestProperty (aName, aValue, aFlags,
    3151                                                  true /* isSetter */,
    3152                                                  &dummy, &dummy64, &dummy);
     3156        if (!directControl)
     3157            rc = E_FAIL;
     3158        else
     3159            rc = directControl->AccessGuestProperty (aName, aValue, aFlags,
     3160                                                     true /* isSetter */,
     3161                                                     &dummy, &dummy64, &dummy);
    31533162    }
    31543163    return rc;
     
    32403249        alock.unlock();
    32413250
    3242         rc = directControl->EnumerateGuestProperties (aPatterns,
    3243                                                       ComSafeArrayOutArg (aNames),
    3244                                                       ComSafeArrayOutArg (aValues),
    3245                                                       ComSafeArrayOutArg (aTimestamps),
    3246                                                       ComSafeArrayOutArg (aFlags));
     3251        if (!directControl)
     3252            rc = E_FAIL;
     3253        else
     3254            rc = directControl->EnumerateGuestProperties (aPatterns,
     3255                                                          ComSafeArrayOutArg (aNames),
     3256                                                          ComSafeArrayOutArg (aValues),
     3257                                                          ComSafeArrayOutArg (aTimestamps),
     3258                                                          ComSafeArrayOutArg (aFlags));
    32473259    }
    32483260    return rc;
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