Skip to content

Commit 4c07eb9

Browse files
committed
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.
1 parent b32e06d commit 4c07eb9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

apps/wolfsshd/auth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ static int CheckPasswordUnix(const char* usr, const byte* pw, word32 pwSz, WOLFS
430430
}
431431

432432
if (pwStr != NULL) {
433+
ForceZero(pwStr, pwSz + 1);
433434
WFREE(pwStr, NULL, DYNTYPE_STRING);
434435
}
435436
if (storedHashCpy != NULL) {

0 commit comments

Comments
 (0)