VirtualBox

Changeset 75730 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Nov 26, 2018 10:57:56 AM (6 years ago)
Author:
vboxsync
Message:

Main/CloudProviderManager: Make sure to keep cloud providers implementing the expected interface only, i.e. drop anything which VBoxSVC doesn't know how to use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/CloudProviderManagerImpl.cpp

    r75667 r75730  
    164164    for (unsigned i = 0; i < apProvidersFromCurrExtPack.size(); i++)
    165165    {
    166         Assert(m_astrExtPackNames.size() == m_apCloudProviders.size());
    167         m_astrExtPackNames.push_back(strName);
    168         m_apCloudProviders.push_back(apProvidersFromCurrExtPack[i]);
     166        // Sanity check each cloud provider by forcing a QueryInterface call,
     167        // making sure that it implements the right interface.
     168        ComPtr<ICloudProvider> pTmpCP1(apProvidersFromCurrExtPack[i]);
     169        if (!pTmpCP1.isNull())
     170        {
     171            ComPtr<ICloudProvider> pTmpCP2;
     172            pTmpCP1.queryInterfaceTo(pTmpCP2.asOutParam());
     173            if (!pTmpCP2.isNull())
     174            {
     175                Assert(m_astrExtPackNames.size() == m_apCloudProviders.size());
     176                m_astrExtPackNames.push_back(strName);
     177                m_apCloudProviders.push_back(apProvidersFromCurrExtPack[i]);
     178            }
     179        }
    169180    }
    170181}
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