Skip to content

Commit b60c599

Browse files
auth test case account for no null terminator with strings when comparing values
1 parent 1bee0c1 commit b60c599

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/auth.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ static int serverUserAuth(byte authType, WS_UserAuthData* authData, void* ctx)
249249
return WOLFSSH_USERAUTH_FAILURE;
250250

251251
}
252-
if (WSTRCMP((const char*)authData->sf.keyboard.responses[resp],
253-
(const char*)kbResponses[resp]) != 0) {
252+
if (WSTRNCMP((const char*)authData->sf.keyboard.responses[resp],
253+
(const char*)kbResponses[resp],
254+
kbResponseLengths[resp]) != 0) {
254255
return WOLFSSH_USERAUTH_FAILURE;
255256
}
256257
}

0 commit comments

Comments
 (0)