VirtualBox

Ignore:
Timestamp:
Nov 8, 2022 9:46:10 PM (2 years ago)
Author:
vboxsync
Message:

IPRT/crypto: Corrected and unified the error checking of d2i_TYPE calls and corrected a i2d_TYPE one. Kudos to fth0 for finding these. ticketref:21097

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/store.cpp

    r96407 r97465  
    445445                    && pCertCtx->cbEncoded > 0)
    446446                {
    447                     X509 *pOsslCert = NULL;
     447                    X509                *pOsslCert = NULL;
    448448                    const unsigned char *pabEncoded = (const unsigned char *)pCertCtx->pabEncoded;
    449                     if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert)
     449                    if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert && pOsslCert != NULL)
    450450                    {
    451451                        if (!X509_STORE_add_cert(pOsslStore, pOsslCert))
     
    501501                    && pCertCtx->cbEncoded > 0)
    502502                {
    503                     X509 *pOsslCert = NULL;
     503                    X509                *pOsslCert = NULL;
    504504                    const unsigned char *pabEncoded = (const unsigned char *)pCertCtx->pabEncoded;
    505                     if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert)
     505                    if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert && pOsslCert != NULL)
    506506                    {
    507507                        if (!sk_X509_push(pOsslStack, pOsslCert))
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