Commit f34b095f authored by Rich Salz's avatar Rich Salz Committed by Rich Salz
Browse files

Add NULL checks from master



The big "don't check for NULL" cleanup requires backporting some
of the lowest-level functions to actually do nothing if NULL is
given.  This will make it easier to backport fixes to release
branches, where master assumes those lower-level functions are "safe"

This commit addresses those tickets: 3798 3799 3801.

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent d3bb25e3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -126,6 +126,8 @@ EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx)

void CMAC_CTX_free(CMAC_CTX *ctx)
{
    if (!ctx)
        return;
    CMAC_CTX_cleanup(ctx);
    OPENSSL_free(ctx);
}
+2 −0
Original line number Diff line number Diff line
@@ -216,6 +216,8 @@ X509_STORE *X509_STORE_new(void)

static void cleanup(X509_OBJECT *a)
{
    if (!a)
        return;
    if (a->type == X509_LU_X509) {
        X509_free(a->data.x509);
    } else if (a->type == X509_LU_CRL) {
+2 −0
Original line number Diff line number Diff line
@@ -2206,6 +2206,8 @@ X509_STORE_CTX *X509_STORE_CTX_new(void)

void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
{
    if (!ctx)
        return;
    X509_STORE_CTX_cleanup(ctx);
    OPENSSL_free(ctx);
}