diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2020-10-07 13:23:01 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2020-10-08 18:17:44 +0300 |
commit | 13c5ec569ea9286ff18e019fb2d53be64829c62c (patch) | |
tree | 759ae93e7305772c97379dfc94638fa2fa1e95fc /crypto/cms | |
parent | 947fb813458cd93fdc31f6248f5806d9f4fddff3 (diff) |
Fix zero-length content verification in S/MIME format
Fixes #13082
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13087)
Diffstat (limited to 'crypto/cms')
-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 f9a851950f..c8bec75cdd 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -401,7 +401,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, 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; |