From 2f2fca6a91f8632e1089244100e7a4856c7da40d Mon Sep 17 00:00:00 2001 From: Zackery Backman Date: Tue, 27 Jan 2026 15:20:21 -0700 Subject: [PATCH] Remove stdio inclusion and then revert removal of null check for MXC free --- wolfcrypt/src/port/maxim/max3266x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/port/maxim/max3266x.c b/wolfcrypt/src/port/maxim/max3266x.c index 4db52113ff..f1a4cbea84 100644 --- a/wolfcrypt/src/port/maxim/max3266x.c +++ b/wolfcrypt/src/port/maxim/max3266x.c @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -887,6 +886,10 @@ int wc_MXC_TPU_SHA_Copy(wc_MXC_Sha* src, wc_MXC_Sha* dst) /* returns void to match other wc_Sha*Free api */ void wc_MXC_TPU_SHA_Free(wc_MXC_Sha* hash) { + if (hash == NULL) { + return; /* Hash Struct is Null already, dont edit potentially */ + /* undefined memory by accident */ + } /* Securely zero the buffer before freeing */ if (hash->msg != NULL) { ForceZero(hash->msg, hash->size);