Remove tabs and newline characters from game name on server side.

This commit is contained in:
lotodore
2012-02-03 21:34:26 +00:00
parent ea4c051cc2
commit 6af6da5658
+5
View File
@@ -1243,6 +1243,11 @@ ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> sess
string gameName(STL_STRING_FROM_OCTET_STRING(newGame.gameInfo.gameName));
// Always trim the game name.
boost::trim(gameName);
boost::replace_all(gameName, "\n", " ");
boost::replace_all(gameName, "\r", " ");
boost::replace_all(gameName, "\t", " ");
boost::replace_all(gameName, "\v", " ");
boost::replace_all(gameName, "\f", " ");
unsigned gameId = GetNextGameId();
if (gameName.empty() || !isprint(gameName[0])) {