VirtualBox

Changeset 40151 in vbox for trunk/src/VBox/Main/webservice


Ignore:
Timestamp:
Feb 16, 2012 2:38:47 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76302
Message:

Main/webservice: fix potential NULL dereference on VBoxSVC crash, and use the newest authentication entry point available in the auth library.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r40130 r40151  
    17211721        pVirtualBox = g_pVirtualBox;
    17221722    }
    1723     pVirtualBox.queryInterfaceTo(ppVirtualBox);
    17241723    if (pVirtualBox.isNull())
    17251724        return rc;
     1725    pVirtualBox.queryInterfaceTo(ppVirtualBox);
    17261726
    17271727    util::AutoReadLock lock(g_pAuthLibLockHandle COMMA_LOCKVAL_SRC_POS);
     
    17601760
    17611761                if (RT_FAILURE(rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY3_NAME, (void**)&pfnAuthEntry3)))
     1762                {
    17621763                    WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", __FUNCTION__, AUTHENTRY3_NAME, rc));
    17631764
    1764                 if (RT_FAILURE(rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY2_NAME, (void**)&pfnAuthEntry2)))
    1765                     WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", __FUNCTION__, AUTHENTRY2_NAME, rc));
    1766 
    1767                 if (RT_FAILURE(rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY_NAME, (void**)&pfnAuthEntry)))
    1768                     WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", __FUNCTION__, AUTHENTRY_NAME, rc));
     1765                    if (RT_FAILURE(rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY2_NAME, (void**)&pfnAuthEntry2)))
     1766                    {
     1767                        WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", __FUNCTION__, AUTHENTRY2_NAME, rc));
     1768
     1769                        if (RT_FAILURE(rc = RTLdrGetSymbol(hlibAuth, AUTHENTRY_NAME, (void**)&pfnAuthEntry)))
     1770                            WEBDEBUG(("%s(): Could not resolve import '%s'. Error code: %Rrc\n", __FUNCTION__, AUTHENTRY_NAME, rc));
     1771                    }
     1772                }
    17691773
    17701774                if (pfnAuthEntry || pfnAuthEntry2 || pfnAuthEntry3)
  • trunk/src/VBox/Main/webservice/vboxweb.h

    r36883 r40151  
    2222void WebLog(const char *pszFormat, ...);
    2323
    24 #define WEBDEBUG(a) if (g_fVerbose) { WebLog a; }
     24#define WEBDEBUG(a) do { if (g_fVerbose) { WebLog a; } } while (0)
    2525
    2626#ifdef DEBUG
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