VirtualBox

Changeset 100442 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Jul 8, 2023 11:10:51 AM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158185
Message:

IPRT,OpenSSL: Support ECDSA for verficiation purposes when IPRT links with OpenSSL. This required quite a bit of cleanups, so not entirely no-risk. bugref:10479 ticketref:21621

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/memsafer-r3.cpp

    r100315 r100442  
    511511    if (pv)
    512512    {
    513         void *pvKey = rtMemSaferScramblePointer(pv);
    514         RTCritSectRwEnterShared(&g_MemSaferCritSect);
    515         PRTMEMSAFERNODE pThis = (PRTMEMSAFERNODE)RTAvlPVGet(&g_pMemSaferTree, pvKey);
    516         if (pThis)
    517             cbRet = pThis->cbUser;
    518         RTCritSectRwLeaveShared(&g_MemSaferCritSect);
     513        /*
     514         * We use this API for testing whether pv is a safer allocation or not,
     515         * so we may be called before the allocators.  Thus, it's prudent to
     516         * make sure initialization has taken place before attempting to enter
     517         * the critical section and such.
     518         */
     519        int rc = RTOnceEx(&g_MemSaferOnce, rtMemSaferOnceInit, rtMemSaferOnceTerm, NULL);
     520        if (RT_SUCCESS(rc))
     521        {
     522            void *pvKey = rtMemSaferScramblePointer(pv);
     523            RTCritSectRwEnterShared(&g_MemSaferCritSect);
     524            PRTMEMSAFERNODE pThis = (PRTMEMSAFERNODE)RTAvlPVGet(&g_pMemSaferTree, pvKey);
     525            if (pThis)
     526                cbRet = pThis->cbUser;
     527            RTCritSectRwLeaveShared(&g_MemSaferCritSect);
     528        }
    519529    }
    520530    return cbRet;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette