mirror of https://github.com/wolfSSL/wolfssh.git
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.pull/881/head
parent
0a0341fea9
commit
c802a7faf4
|
|
@ -413,7 +413,7 @@ static int CheckPasswordUnix(const char* usr, const byte* pw, word32 pwSz, WOLFS
|
|||
}
|
||||
if (ret == WS_SUCCESS) {
|
||||
storedHashCpy = WSTRDUP(storedHash, NULL, DYNTYPE_STRING);
|
||||
if (storedHash == NULL) {
|
||||
if (storedHashCpy == NULL) {
|
||||
wolfSSH_Log(WS_LOG_ERROR,
|
||||
"[SSHD] Error getting stored hash copy");
|
||||
ret = WS_MEMORY_E;
|
||||
|
|
|
|||
Loading…
Reference in New Issue