We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9facb40 commit e13d2baCopy full SHA for e13d2ba
src/network/serverpackethandler.cpp
@@ -164,9 +164,11 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
164
*/
165
const char* playername = playerName.c_str();
166
167
- if (playerName.size() > PLAYERNAME_SIZE) {
168
- actionstream << "Server: Player with an too long name "
169
- << "tried to connect from " << addr_s << std::endl;
+ size_t pns = playerName.size();
+ if (pns == 0 || pns > PLAYERNAME_SIZE) {
+ actionstream << "Server: Player with "
170
+ << ((pns > PLAYERNAME_SIZE) ? "a too long" : "an empty")
171
+ << " name tried to connect from " << addr_s << std::endl;
172
DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_WRONG_NAME);
173
return;
174
}
👍
1 commit comments
nerzhul commentedon May 23, 2015
👍