From: Phillip Hellewell Date: Sun, 12 Jun 2016 00:04:21 +0000 (-0400) Subject: RT3053: Check for NULL before dereferencing X-Git-Tag: OpenSSL_1_0_2i~152 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=63b2499b6733022c6d1906709df4d808c44b634e;p=oweals%2Fopenssl.git RT3053: Check for NULL before dereferencing Reviewed-by: Tim Hudson (cherry picked from commit 6b3602882e089aaca18828a72d9f4072e6a20252) --- 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: