Detect symmetric crypto errors in PKCS7_decrypt.
[oweals/openssl.git] / crypto / dsa / dsa_ameth.c
index b38e1a4ee99a88481aaca280a44bf8835bfc1f0a..376156ec5ef3a6ad23539296601180f7b4fa1472 100644 (file)
@@ -547,7 +547,15 @@ static int dsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,
                                        int indent, ASN1_PCTX *pctx)
        {
        DSA_SIG *dsa_sig;
-       const unsigned char *p = sig->data;
+       const unsigned char *p;
+       if (!sig)
+               {
+               if (BIO_puts(bp, "\n") <= 0)
+                       return 0;
+               else
+                       return 1;
+               }
+       p = sig->data;
        dsa_sig = d2i_DSA_SIG(NULL, &p, sig->length);
        if (dsa_sig)
                {