diff options
author | Rich Salz <rsalz@openssl.org> | 2016-04-25 08:56:54 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-04-25 11:44:24 -0400 |
commit | 79356a83b78a2d936dcd022847465d9ebf6c67b1 (patch) | |
tree | ea097498d2f821cd3b7a970748e8b7b477298926 /apps/pkcs7.c | |
parent | 1755d4601231f96e9011abc3d2f40e7bd31320ee (diff) | |
download | openssl-79356a83b78a2d936dcd022847465d9ebf6c67b1.tar.gz |
Fix NULL deref in apps/pkcs7
Thanks to Brian Carpenter for finding and reporting this.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'apps/pkcs7.c')
-rw-r--r-- | apps/pkcs7.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/pkcs7.c b/apps/pkcs7.c index ad8330d42f..a2c1c6d04e 100644 --- a/apps/pkcs7.c +++ b/apps/pkcs7.c @@ -222,12 +222,16 @@ int pkcs7_main(int argc, char **argv) i = OBJ_obj2nid(p7->type); switch (i) { case NID_pkcs7_signed: - certs = p7->d.sign->cert; - crls = p7->d.sign->crl; + if (p7->d.sign != NULL) { + certs = p7->d.sign->cert; + crls = p7->d.sign->crl; + } break; case NID_pkcs7_signedAndEnveloped: - certs = p7->d.signed_and_enveloped->cert; - crls = p7->d.signed_and_enveloped->crl; + if (p7->d.signed_and_enveloped != NULL) { + certs = p7->d.signed_and_enveloped->cert; + crls = p7->d.signed_and_enveloped->crl; + } break; default: break; |