Commit 4f25aecd authored by J Mohan Rao Arisankala's avatar J Mohan Rao Arisankala Committed by Rich Salz
Browse files

explicit check for NULL

parent 2c91b3f5
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -243,12 +243,12 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
    type = EVP_MD_CTX_md(ctx);
    type = EVP_MD_CTX_md(ctx);
    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_pkey_ctx(ctx));
    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_pkey_ctx(ctx));


    if (!type || !pkey) {
    if (NULL == type || NULL == pkey) {
        ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_CONTEXT_NOT_INITIALISED);
        ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_CONTEXT_NOT_INITIALISED);
        goto err;
        goto err;
    }
    }


    if (!pkey->ameth) {
    if (NULL == pkey->ameth) {
        ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
        ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
        goto err;
        goto err;
    }
    }