diff options
author | Phillip Hellewell <sshock@gmail.com> | 2016-06-11 20:04:21 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-06-12 07:54:31 -0400 |
commit | 63b2499b6733022c6d1906709df4d808c44b634e (patch) | |
tree | 1d7354871b5a29b0123cfc6e12b7ae88a2947f44 /crypto/cms | |
parent | 5bbdc26cadc01cab811040e861f1f98e0f3af348 (diff) |
RT3053: Check for NULL before dereferencing
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 6b3602882e089aaca18828a72d9f4072e6a20252)
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms_lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index d6cb60d02d..6d27c4969b 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -413,6 +413,8 @@ static STACK_OF(CMS_CertificateChoices) return &cms->d.signedData->certificates; case NID_pkcs7_enveloped: + if (cms->d.envelopedData->originatorInfo == NULL) + return NULL; return &cms->d.envelopedData->originatorInfo->certificates; default: @@ -488,6 +490,8 @@ static STACK_OF(CMS_RevocationInfoChoice) return &cms->d.signedData->crls; case NID_pkcs7_enveloped: + if (cms->d.envelopedData->originatorInfo == NULL) + return NULL; return &cms->d.envelopedData->originatorInfo->crls; default: |