We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac1e43f commit ee3c785Copy full SHA for ee3c785
1 file changed
wolfcrypt/src/port/maxim/max3266x.c
@@ -29,7 +29,6 @@
29
30
#include <stdint.h>
31
#include <stdarg.h>
32
-#include <stdio.h>
33
34
#include <wolfssl/wolfcrypt/wolfmath.h>
35
#include <wolfssl/wolfcrypt/error-crypt.h>
@@ -887,6 +886,10 @@ int wc_MXC_TPU_SHA_Copy(wc_MXC_Sha* src, wc_MXC_Sha* dst)
887
886
/* returns void to match other wc_Sha*Free api */
888
void wc_MXC_TPU_SHA_Free(wc_MXC_Sha* hash)
889
{
+ if (hash == NULL) {
890
+ return; /* Hash Struct is Null already, dont edit potentially */
891
+ /* undefined memory by accident */
892
+ }
893
/* Securely zero the buffer before freeing */
894
if (hash->msg != NULL) {
895
ForceZero(hash->msg, hash->size);
0 commit comments