diff options
Diffstat (limited to 'src/sh_socket.c')
-rw-r--r-- | src/sh_socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sh_socket.c b/src/sh_socket.c index f4e9f56..e75433b 100644 --- a/src/sh_socket.c +++ b/src/sh_socket.c @@ -808,7 +808,7 @@ static int get_peer_uid(int talkfd) #endif #if defined(NEED_PASSWORD_AUTH) -char * check_password(char * message, int * client_uid, int talkfd) +char * check_password(char * message, size_t msglen, int * client_uid, int talkfd) { char * cmd = NULL; char * eopw = NULL; @@ -822,7 +822,7 @@ char * check_password(char * message, int * client_uid, int talkfd) * message is null-terminated and >> goodpassword */ if (0 == strcmp(goodpassword, message) && - strlen(goodpassword) < (sizeof(message)/2)) + strlen(goodpassword) < (msglen/2)) { *client_uid = sh_socket_flaguid; cmd = &message[strlen(goodpassword)+1]; @@ -901,7 +901,7 @@ int sh_socket_read (struct socket_cmd * srvcmd) cmd = message; #elif defined(NEED_PASSWORD_AUTH) - cmd = check_password(message, &client_uid, talkfd); + cmd = check_password(message, sizeof(message), &client_uid, talkfd); #else sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN, |