Skip to content

Commit ee3c785

Browse files
committed
Remove stdio inclusion and then revert removal of null check for MXC free
1 parent ac1e43f commit ee3c785

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

wolfcrypt/src/port/maxim/max3266x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#include <stdint.h>
3131
#include <stdarg.h>
32-
#include <stdio.h>
3332

3433
#include <wolfssl/wolfcrypt/wolfmath.h>
3534
#include <wolfssl/wolfcrypt/error-crypt.h>
@@ -887,6 +886,10 @@ int wc_MXC_TPU_SHA_Copy(wc_MXC_Sha* src, wc_MXC_Sha* dst)
887886
/* returns void to match other wc_Sha*Free api */
888887
void wc_MXC_TPU_SHA_Free(wc_MXC_Sha* hash)
889888
{
889+
if (hash == NULL) {
890+
return; /* Hash Struct is Null already, dont edit potentially */
891+
/* undefined memory by accident */
892+
}
890893
/* Securely zero the buffer before freeing */
891894
if (hash->msg != NULL) {
892895
ForceZero(hash->msg, hash->size);

0 commit comments

Comments
 (0)