From b60c599c36c3aa8b9996139ef90545caccbaa42d Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 29 May 2025 10:48:44 -0600 Subject: [PATCH] auth test case account for no null terminator with strings when comparing values --- tests/auth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auth.c b/tests/auth.c index 8a19568f..aa52c3ad 100644 --- a/tests/auth.c +++ b/tests/auth.c @@ -249,8 +249,9 @@ static int serverUserAuth(byte authType, WS_UserAuthData* authData, void* ctx) return WOLFSSH_USERAUTH_FAILURE; } - if (WSTRCMP((const char*)authData->sf.keyboard.responses[resp], - (const char*)kbResponses[resp]) != 0) { + if (WSTRNCMP((const char*)authData->sf.keyboard.responses[resp], + (const char*)kbResponses[resp], + kbResponseLengths[resp]) != 0) { return WOLFSSH_USERAUTH_FAILURE; } }