From: Dr. David von Oheimb Date: Thu, 25 May 2023 15:48:04 +0000 (+0200) Subject: SMIME_crlf_copy(): check for NULL pointer arguments X-Git-Tag: openssl-3.1.2~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84025cf423693db3af4a6667d415424c669f0c79;p=thirdparty%2Fopenssl.git SMIME_crlf_copy(): check for NULL pointer arguments Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/21058) (cherry picked from commit 23450cfb9204615e97467e8be6a709141523a59e) --- diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index b44b0f36858..7ab7bc87ed9 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.