summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x_all.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-12-11 19:24:46 +1000
committerTomas Mraz <tomas@openssl.org>2021-01-18 15:01:26 +0100
commit038f4dc68edd16f719ce5cf140eda2fb5b86a62a (patch)
treec91c66bd82817b4bd83810278bc5b0074854d69d /crypto/x509/x_all.c
parent84af8027c5f2132a9166673e7a47b0f31c7cfe1d (diff)
Fix PKCS7 potential segfault
As the code that handles libctx, propq for PKCS7 is very similar to CMS code, a similiar fix for issue #13624 needs to be applied. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13668)
Diffstat (limited to 'crypto/x509/x_all.c')
-rw-r--r--crypto/x509/x_all.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c
index 9d9079f7f5..3a0e8bc181 100644
--- a/crypto/x509/x_all.c
+++ b/crypto/x509/x_all.c
@@ -178,7 +178,7 @@ PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7)
PKCS7 *ret;
ret = ASN1_item_d2i_fp(ASN1_ITEM_rptr(PKCS7), fp, p7);
- if (ret != NULL && p7 != NULL)
+ if (ret != NULL)
pkcs7_resolve_libctx(ret);
return ret;
}
@@ -194,7 +194,7 @@ PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7)
PKCS7 *ret;
ret = ASN1_item_d2i_bio(ASN1_ITEM_rptr(PKCS7), bp, p7);
- if (ret != NULL && p7 != NULL)
+ if (ret != NULL)
pkcs7_resolve_libctx(ret);
return ret;
}