Skip to content

Commit 6301993

Browse files
spelling fix, additional sanity checks
1 parent 39c2103 commit 6301993

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/build-and-test-clientonly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ jobs:
8585
make -j CLIENT_ONLY=1 TLS=1 SHE=1 DEBUG_VERBOSE=1 WOLFSSL_DIR=../wolfssl && make run
8686
fi
8787
88-
# Restart server with fresh state for AUTH test run, even with the serer not
89-
# supporting AUTH and the client supporting AUTH -- the client should still
90-
# be able to connect and run tests while not authenticated.
88+
# Restart server with fresh state for AUTH test run, even with the server
89+
# not supporting AUTH and the client supporting AUTH -- the client should
90+
# still be able to connect and run tests while not authenticated.
9191
- name: Restart POSIX server for AUTH
9292
run: |
9393
kill $SERVER_PID || true

port/posix/posix_auth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ int posixAuth_Init(void* context, const void* config)
6464
(void)context;
6565
(void)config;
6666

67+
memset(users, 0, sizeof(users));
6768
return WH_ERROR_OK;
6869
}
6970

@@ -186,7 +187,7 @@ int posixAuth_Login(void* context, uint8_t client_id, whAuthMethod method,
186187
whAuthBase_User* current_user = NULL;
187188

188189
if ((out_user_id == NULL) || (out_permissions == NULL) ||
189-
(loggedIn == NULL)) {
190+
(loggedIn == NULL) || (username == NULL)) {
190191
return WH_ERROR_BADARGS;
191192
}
192193

src/wh_message_auth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ int wh_MessageAuth_TranslateLoginRequest(
7070
if (src_header != dest_header) {
7171
memcpy(dest_header->username, src_header->username,
7272
sizeof(dest_header->username));
73+
/* make sure the destination username is null terminated */
74+
dest_header->username[sizeof(dest_header->username) - 1] = '\0';
7375
}
7476
WH_T16(magic, dest_header, src_header, auth_data_len);
7577

0 commit comments

Comments
 (0)