Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -8537,6 +8537,11 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey)
return MEMORY_E;
}

/* Zero the key so the failure path below can run the type's free
* function even when its init function failed before initializing
* anything: freeing an uninitialized key walks garbage lengths. */
XMEMSET(*pKey, 0, sz);

/* Initialize key */
switch (type) {
#ifndef NO_RSA
Expand Down