mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
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)
This commit is contained in:
parent
947fb81345
commit
13c5ec569e
@ -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;
|
||||
|
@ -311,7 +311,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
|
||||
char *ptr;
|
||||
long len;
|
||||
len = BIO_get_mem_data(indata, &ptr);
|
||||
tmpin = BIO_new_mem_buf(ptr, len);
|
||||
tmpin = (len == 0) ? indata : BIO_new_mem_buf(ptr, len);
|
||||
if (tmpin == NULL) {
|
||||
PKCS7err(0, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
|
Loading…
Reference in New Issue
Block a user