Fix d4a4370050f7d72239b92a60ab9d4a2dd5e9fd84
[openssl.git] / crypto / asn1 / a_verify.c
index 807587e628442466731db667aaaae4784f19b98e..87e7ef4f5ec0f83368299e8c221b9b395ef46512 100644 (file)
@@ -140,6 +140,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
 
        int mdnid, pknid;
 
+       if (!pkey)
+               {
+               ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER);
+               return -1;
+               }
+
        EVP_MD_CTX_init(&ctx);
 
        /* Convert signature OID into digest and public key OIDs */