Fix for blank username/password in server

audioplugins
Phil Taylor 2021-07-26 10:27:39 +01:00
rodzic 59234f25f7
commit 93ec46e077
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -318,7 +318,8 @@ void udpServer::controlReceived()
passcode(user.username, usercomp);
QByteArray passcomp;
passcode(user.password, passcomp);
if (!strcmp(in->username, usercomp.constData()) && (!strcmp(in->password, user.password.toUtf8()) || !strcmp(in->password, passcomp.constData())))
if (!user.username.trimmed().isEmpty() && !user.password.trimmed().isEmpty() && !strcmp(in->username, usercomp.constData()) &&
(!strcmp(in->password, user.password.toUtf8()) || !strcmp(in->password, passcomp.constData())))
{
current->isAuthenticated = true;
current->user = user;