diff --git a/src/client.cpp b/src/client.cpp index de813187..d2ec7017 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -880,6 +880,7 @@ void Client::ProcessData(NetworkPacket *pkt) if (command >= TOCLIENT_NUM_MSG_TYPES) { infostream << "Client: Ignoring unknown command " << command << std::endl; + return; } /* diff --git a/src/server.cpp b/src/server.cpp index 52bc9867..0e3d94fa 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1206,6 +1206,7 @@ void Server::ProcessData(NetworkPacket *pkt) if (command >= TOSERVER_NUM_MSG_TYPES) { infostream << "Server: Ignoring unknown command " << command << std::endl; + return; } if (toServerCommandTable[command].state == TOSERVER_STATE_NOT_CONNECTED) {