summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2023-05-25 17:48:04 +0200
committerDr. David von Oheimb <dev@ddvo.net>2023-06-01 09:57:50 +0200
commit4b4819d0a7e0f73369dc147cb781a71723ae7e85 (patch)
treeca2ce86a544d80d4bc8ca802dd82ecb7845174bf
parentcb1f87f59d0b290eca9207ec4ef36d8073e6feec (diff)
SMIME_crlf_copy(): check for NULL pointer arguments
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/21058) (cherry picked from commit 23450cfb9204615e97467e8be6a709141523a59e)
-rw-r--r--crypto/asn1/asn_mime.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index b44b0f3685..7ab7bc87ed 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -516,6 +516,12 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags)
int len;
char linebuf[MAX_SMLEN];
int ret;
+
+ if (in == NULL || out == NULL) {
+ ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
+ return 0;
+ }
+
/*
* Buffer output so we don't write one line at a time. This is useful
* when streaming as we don't end up with one OCTET STRING per line.