VirtualBox

Changeset 60261 in vbox for trunk/include


Ignore:
Timestamp:
Mar 30, 2016 2:10:13 PM (9 years ago)
Author:
vboxsync
Message:

HostServices/Service.h: Only copy parameters if a valid parameter count is given.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/Service.h

    r59830 r60261  
    133133        cleanup();
    134134
    135         m_uMsg = uMsg;
     135        m_uMsg   = uMsg;
    136136        m_cParms = cParms;
    137137
    138         if (cParms > 0)
     138        int rc;
     139        if (cParms)
    139140        {
    140141            m_paParms = (VBOXHGCMSVCPARM*)RTMemAllocZ(sizeof(VBOXHGCMSVCPARM) * m_cParms);
    141             if (!m_paParms)
    142                 return VERR_NO_MEMORY;
     142            if (m_paParms)
     143            {
     144                rc = copyParmsInternal(m_paParms, m_cParms, &aParms[0], cParms, true /* fDeepCopy */);
     145                if (RT_FAILURE(rc))
     146                    cleanup();
     147            }
     148            else
     149                rc = VERR_NO_MEMORY;
    143150        }
    144 
    145         int rc = copyParmsInternal(m_paParms, m_cParms, &aParms[0], cParms, true /* fDeepCopy */);
    146         if (RT_FAILURE(rc))
    147             cleanup();
    148151
    149152        return rc;
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