From f5df9f29d229dc92058aa5dc1d6b41386890c143 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Fri, 17 Jun 2016 06:42:19 +0000 Subject: [PATCH] close another loophole that allowed ghost accounts --- .../LoginServer/src/shared/ClientConnection.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index 911116b1..6bda53cc 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -175,8 +175,15 @@ void ClientConnection::validateClient(const std::string & id, const std::string // to avoid having to re-type this stupid var all over the place // ideally we wouldn't copy this here, but it would be a huge pain const std::string trimmedId = trim(id); - - StationId suid = atoi(trimmedId.c_str()); + + // and to avoid funny business with atoi and casing + // make it a separate var than the one we send the auth server + std::string lcaseId; + lcaseId.resize(trimmedId.size()); + + std::transform(trimmedId.begin(),trimmedId.end(),lcaseId.begin(),::tolower); + + StationId suid = atoi(lcaseId.c_str()); int authOK = 0; if (suid == 0)