summaryrefslogtreecommitdiff
path: root/crypto/pkcs7
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2022-07-26 15:17:06 +0300
committerHugo Landau <hlandau@openssl.org>2022-07-28 10:05:59 +0100
commit67c0460b89cc1b0644a1a59af78284dfd8d720af (patch)
tree90dc060cd2fb8ec810f9d58d691f056f0ff3f3bb /crypto/pkcs7
parentb03756130dadb3732b460a6efd930f1b226acdad (diff)
downloadopenssl-new-67c0460b89cc1b0644a1a59af78284dfd8d720af.tar.gz
Handle SMIME_crlf_copy return code
Currently the SMIME_crlf_copy result is ignored in all usages. It does return failure when memory allocation fails. This patch handles the SMIME_crlf_copy return code in all occurrences. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18876)
Diffstat (limited to 'crypto/pkcs7')
-rw-r--r--crypto/pkcs7/pk7_smime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c
index cac03011cf..4414963b5a 100644
--- a/crypto/pkcs7/pk7_smime.c
+++ b/crypto/pkcs7/pk7_smime.c
@@ -81,7 +81,8 @@ int PKCS7_final(PKCS7 *p7, BIO *data, int flags)
return 0;
}
- SMIME_crlf_copy(data, p7bio, flags);
+ if (!SMIME_crlf_copy(data, p7bio, flags))
+ goto err;
(void)BIO_flush(p7bio);