VirtualBox

Changeset 50151 in vbox


Ignore:
Timestamp:
Jan 21, 2014 7:16:49 PM (11 years ago)
Author:
vboxsync
Message:

Wrapper.h: Fixed regression in IAppliance::importMachines where a NULL options array was causing assertions in debug builds despite working fine before conversion to wrappers. (tstOVF triggered it)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/Wrapper.h

    r49763 r50151  
    151151    ArrayBSTRInConverter(ComSafeArrayIn(IN_BSTR, aSrc))
    152152    {
     153        /** @todo How to handle ComSafeArrayInIsNull(aSrc)?  Is it appropriate to
     154         *        assert everywhere like we currently do?  It wasn't for the
     155         *        ArrayInConverter class (IAppliance::importMachines)... */
    153156        com::SafeArray<IN_BSTR> inArray(ComSafeArrayInArg(aSrc));
    154157        mArray.resize(inArray.size());
     
    381384    ArrayComTypeInConverter(ComSafeArrayIn(A *, aSrc))
    382385    {
     386        /** @todo How to handle ComSafeArrayInIsNull(aSrc)?  Is it appropriate to
     387         *        assert everywhere like we currently do?  It wasn't for the
     388         *        ArrayInConverter class (IAppliance::importMachines)... */
    383389        com::SafeIfaceArray<A> inArray(ComSafeArrayInArg(aSrc));
    384390        mArray.resize(inArray.size());
     
    460466    ArrayInConverter(ComSafeArrayIn(A, aSrc))
    461467    {
    462         com::SafeArray<A> inArray(ComSafeArrayInArg(aSrc));
    463         mArray.resize(inArray.size());
    464         for (size_t i = 0; i < inArray.size(); i++)
    465             mArray[i] = inArray[i];
     468        if (!ComSafeArrayInIsNull(aSrc))
     469        {
     470            com::SafeArray<A> inArray(ComSafeArrayInArg(aSrc));
     471            mArray.resize(inArray.size());
     472            for (size_t i = 0; i < inArray.size(); i++)
     473                mArray[i] = inArray[i];
     474        }
    466475    }
    467476
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