Skip to content

Commit 2120424

Browse files
Merge pull request #7394 from embhorn/zd17779
Add null check to wolfSSL_Free
2 parents 55ea330 + 4e5a98e commit 2120424

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/src/memory.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,10 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
11411141
#endif
11421142
}
11431143
mem = hint->memory;
1144+
if (mem == NULL) {
1145+
WOLFSSL_MSG("Bad hint pointer to memory");
1146+
return;
1147+
}
11441148

11451149
/* get memory struct and add it to available list */
11461150
pt = (wc_Memory*)((byte*)ptr - sizeof(wc_Memory) - padSz);

0 commit comments

Comments
 (0)