summaryrefslogtreecommitdiff
path: root/src/network/network_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network_client.cpp')
-rw-r--r--src/network/network_client.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index a0a828a37..fbc5809df 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -1067,12 +1067,13 @@ DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_RCON)
{
if (this->status < STATUS_AUTHORIZED) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
- char rcon_out[NETWORK_RCONCOMMAND_LENGTH];
+ uint colour_code = p->Recv_uint16();
+ if (!IsValidConsoleColour(colour_code)) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
- ConsoleColour colour_code = (ConsoleColour)p->Recv_uint16();
+ char rcon_out[NETWORK_RCONCOMMAND_LENGTH];
p->Recv_string(rcon_out, sizeof(rcon_out));
- IConsolePrint(colour_code, rcon_out);
+ IConsolePrint((ConsoleColour)colour_code, rcon_out);
return NETWORK_RECV_STATUS_OKAY;
}