From 6f1fe2e4b916e22e7342c3bc7d88f3fc298a4473 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 23 Apr 2025 17:11:05 -0600 Subject: [PATCH] add sanity check on des cbc decrypt, CID 512990 --- wolfcrypt/src/des3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 7a9ba3bc7..c4593c226 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -1742,6 +1742,10 @@ { word32 blocks = sz / DES_BLOCK_SIZE; + if (des == NULL || out == NULL || in == NULL) { + return BAD_FUNC_ARG; + } + while (blocks--) { XMEMCPY(des->tmp, in, DES_BLOCK_SIZE); DesProcessBlock(des, (byte*)des->tmp, out);