diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2020-10-09 20:04:05 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2020-11-11 13:50:42 +0300 |
commit | 6f1bee08cf80b9473496991b51f1f4a0decd96de (patch) | |
tree | da05317258eca1cd41e6b9eb11169b7f4fbf5923 /crypto/cms/cms_smime.c | |
parent | 6e933b35492a4dc3370b9f49890646dadca82cd8 (diff) |
Verification zero-length content in S/MIME format
Fixes #13082
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13106)
Diffstat (limited to 'crypto/cms/cms_smime.c')
-rw-r--r-- | crypto/cms/cms_smime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 652e97b2e8..2c475ea68c 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -341,7 +341,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, char *ptr; long len; len = BIO_get_mem_data(dcont, &ptr); - tmpin = BIO_new_mem_buf(ptr, len); + tmpin = (len == 0) ? dcont : BIO_new_mem_buf(ptr, len); if (tmpin == NULL) { CMSerr(CMS_F_CMS_VERIFY, ERR_R_MALLOC_FAILURE); goto err2; |