Commit 3ff5158b authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files

server crash fix

parent 4f4049fc
...@@ -56,9 +56,13 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString ...@@ -56,9 +56,13 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
if (authState == PasswordWrong) if (authState == PasswordWrong)
return authState; return authState;
ServerInfo_User *data = getUserData(name);
name = data->getName(); // Compensate for case indifference
if (authState == PasswordRight) { if (authState == PasswordRight) {
if (users.contains(name)) { if (users.contains(name)) {
qDebug("Login denied: would overwrite old session"); qDebug("Login denied: would overwrite old session");
delete data;
return WouldOverwriteOldSession; return WouldOverwriteOldSession;
} }
} else if (authState == UnknownUser) { } else if (authState == UnknownUser) {
...@@ -71,8 +75,6 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString ...@@ -71,8 +75,6 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
name = tempName; name = tempName;
} }
ServerInfo_User *data = getUserData(name);
name = data->getName(); // Compensate for case indifference
session->setUserInfo(data); session->setUserInfo(data);
users.insert(name, session); users.insert(name, session);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment