Commit d31bc179 authored by Rich Salz's avatar Rich Salz
Browse files

Fix NULL deref in apps/pkcs7



Thanks to Brian Carpenter for finding and reporting this.

Reviewed-by: default avatarEmilia Käsper <emilia@openssl.org>
(cherry picked from commit 79356a83)
parent 0b48a24c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -235,12 +235,16 @@ int MAIN(int argc, char **argv)
        i = OBJ_obj2nid(p7->type);
        switch (i) {
        case NID_pkcs7_signed:
            if (p7->d.sign != NULL) {
                certs = p7->d.sign->cert;
                crls = p7->d.sign->crl;
            }
            break;
        case NID_pkcs7_signedAndEnveloped:
            if (p7->d.signed_and_enveloped != NULL) {
                certs = p7->d.signed_and_enveloped->cert;
                crls = p7->d.signed_and_enveloped->crl;
            }
            break;
        default:
            break;