From: Rajeev Ranjan Date: Mon, 4 Mar 2024 10:41:01 +0000 (+0100) Subject: cipher_null.c: add NULL check X-Git-Tag: openssl-3.4.0-alpha1~558 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61f32392dd67d47018ce46f427339e7191426e45;p=thirdparty%2Fopenssl.git cipher_null.c: add NULL check Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22903) --- diff --git a/providers/implementations/ciphers/cipher_null.c b/providers/implementations/ciphers/cipher_null.c index c911049e2d0..81f9fa10be4 100644 --- a/providers/implementations/ciphers/cipher_null.c +++ b/providers/implementations/ciphers/cipher_null.c @@ -82,7 +82,7 @@ static int null_cipher(void *vctx, unsigned char *out, size_t *outl, } if (outsize < inl) return 0; - if (in != out) + if (out != NULL && in != out) memcpy(out, in, inl); *outl = inl; return 1;