Fix off-by-one in username length check

pull/212/head
Lauri Kasanen 2 years ago
parent 6cd50869c2
commit 73c3bda8cd
No known key found for this signature in database

@ -1794,7 +1794,7 @@ ws_ctx_t *do_handshake(int sock, char * const ip) {
if (resppw && *resppw)
resppw++;
if (settings.passwdfile) {
if (resppw && *resppw && resppw - response < 32) {
if (resppw && *resppw && resppw - response < USERNAME_LEN + 1) {
char pwbuf[4096];
struct kasmpasswd_t *set = readkasmpasswd(settings.passwdfile);
if (!set->num) {

Loading…
Cancel
Save