From 1f082911edb8d68975447e63821eebf95754354f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:10:19 +0000 Subject: [PATCH] Fix: Add additional checks for NULL input and zero length input in WC_NULL_CIPHER_TYPE case Co-Authored-By: lealem@wolfssl.com --- wolfcrypt/src/evp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index c8647fd5b..cce76a3ba 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -1063,7 +1063,9 @@ int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx, if (out == NULL) { return WOLFSSL_FAILURE; } - XMEMCPY(out, in, inl); + if (in != NULL && inl > 0) { + XMEMCPY(out, in, inl); + } *outl = inl; return WOLFSSL_SUCCESS; #if !defined(NO_AES) && defined(HAVE_AESGCM)