VirtualBox

Changeset 25098 in vbox


Ignore:
Timestamp:
Nov 30, 2009 10:01:05 AM (15 years ago)
Author:
vboxsync
Message:

Main/NetworkAdapter: fix NULL handling in NAT network attribute

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r23222 r25098  
    506506STDMETHODIMP NetworkAdapter::COMSETTER(NATNetwork) (IN_BSTR aNATNetwork)
    507507{
     508    Bstr bstrEmpty("");
     509    if (!aNATNetwork)
     510        aNATNetwork = bstrEmpty;
     511
    508512    AutoCaller autoCaller(this);
    509513    CheckComRCReturnRC(autoCaller.rc());
     
    935939        case NetworkAttachmentType_NAT:
    936940            mData->mNATNetwork = data.strName;
     941            if (mData->mNATNetwork.isNull())
     942                mData->mNATNetwork = "";
    937943            rc = AttachToNAT();
    938944            CheckComRCReturnRC(rc);
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r24989 r25098  
    4545    struct Data
    4646    {
    47         Data()
    48             : mSlot (0), mEnabled (FALSE)
    49             , mAttachmentType (NetworkAttachmentType_Null)
    50             ,  mCableConnected (TRUE), mLineSpeed (0), mTraceEnabled (FALSE)
    51             , mHostInterface ("") /* cannot be null */
     47        Data() : mSlot(0), mEnabled(FALSE),
     48                 mAttachmentType(NetworkAttachmentType_Null),
     49                 mCableConnected(TRUE), mLineSpeed(0), mTraceEnabled(FALSE),
     50                 mHostInterface("") /* cannot be null */,
     51                 mNATNetwork("") /* cannot be null */
    5252        {}
    5353
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