Missing ForceZero on plaintext password copy

When a copy of the user's password is freed, it wasn't getting force
zeroed. It might still exist in the heap after getting freed.  Added
a call to `ForceZero()`.

Affected function: CheckPasswordUnix.
Issue: F-56
pull/883/head
John Safranek 2026-03-03 11:30:08 -08:00
parent 86636797ee
commit 3cfec8b3d2
1 changed files with 1 additions and 0 deletions

View File

@ -430,6 +430,7 @@ static int CheckPasswordUnix(const char* usr, const byte* pw, word32 pwSz, WOLFS
}
if (pwStr != NULL) {
ForceZero(pwStr, pwSz + 1);
WFREE(pwStr, NULL, DYNTYPE_STRING);
}
if (storedHashCpy != NULL) {