From 8d017f0ea1e21276d00f3325acd71e40c53cfc39 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 7 Jan 2009 15:27:19 +0000 Subject: (svn r14897) -Codechange: don't allow a few command flags to be sent over the network as it's bogus information anyway; e.g. the "do not send over network" flag as it will be set whenever the command is received from the server/client. -Codechange: test earlier whether the command (send from the server) is actually valid. --- src/network/network_server.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/network/network_server.cpp') diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 2fc06f4a1..e496bb6a5 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -839,6 +839,11 @@ static bool CheckCommandFlags(const CommandPacket *cp, const NetworkClientInfo * return false; } + if ((cp->cmd & CMD_FLAGS_MASK) != 0) { + IConsolePrintF(CC_ERROR, "WARNING: invalid command flag from client %d (IP: %s), kicking...", ci->client_id, GetClientIP(ci)); + return false; + } + return true; } -- cgit v1.2.3-54-g00ecf