From 7b7c658668af8d52f19c4473e2fca319d27151d3 Mon Sep 17 00:00:00 2001 From: Ruby Martin Date: Mon, 7 Jul 2025 14:10:41 -0600 Subject: [PATCH] add null check to wc_Des_CbcEncrypt --- wolfcrypt/src/des3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index adefaa229..4ab5b7415 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -1727,6 +1727,10 @@ { word32 blocks = sz / DES_BLOCK_SIZE; + if (des == NULL || out == NULL || in == NULL) { + return BAD_FUNC_ARG; + } + while (blocks--) { xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE); DesProcessBlock(des, (byte*)des->reg, (byte*)des->reg);