close another loophole that allowed ghost accounts

This commit is contained in:
DarthArgus
2016-06-17 06:42:19 +00:00
parent 3c2243269a
commit f5df9f29d2
@@ -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)