Skip to content

Commit c802a7f

Browse files
committed
Fix null check for duplicated string
When making a copy of a string, check the destination pointer of the copy rather than the original. Affected function: CheckPasswordUnix.
1 parent 0a0341f commit c802a7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/wolfsshd/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static int CheckPasswordUnix(const char* usr, const byte* pw, word32 pwSz, WOLFS
413413
}
414414
if (ret == WS_SUCCESS) {
415415
storedHashCpy = WSTRDUP(storedHash, NULL, DYNTYPE_STRING);
416-
if (storedHash == NULL) {
416+
if (storedHashCpy == NULL) {
417417
wolfSSH_Log(WS_LOG_ERROR,
418418
"[SSHD] Error getting stored hash copy");
419419
ret = WS_MEMORY_E;

0 commit comments

Comments
 (0)