From 648e5807a0339aaabde7ced0f3da712fdcab343f Mon Sep 17 00:00:00 2001 From: apathy Date: Thu, 4 Aug 2016 03:21:32 -0700 Subject: [PATCH] truncate the id to MAX_ACCOUNT_NAME_LENGTH before generating station id's --- .../application/LoginServer/src/shared/ClientConnection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index a2db9786..37c93d58 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -174,7 +174,10 @@ 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); + std::string tmp = trim(id); + tmp.resize(MAX_ACCOUNT_NAME_LENGTH); // truncate name after the trim + + const std::string trimmedId = tmp; const std::string trimmedKey = trim(key); // and to avoid funny business with atoi and casing