aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-21 23:56:46 +0200
committersapier <Sapier at GMX dot net>2014-06-21 23:56:46 +0200
commitf8522d50e7c92438a3397d9965ac346613fbbfb9 (patch)
tree1ba6e233be704c1ec4a95da7933fe19cc26510fe /src
parent2b9beead3816709aca55ce17e647f47fd6c0314c (diff)
downloadminetest-f8522d50e7c92438a3397d9965ac346613fbbfb9.tar.gz
minetest-f8522d50e7c92438a3397d9965ac346613fbbfb9.tar.bz2
minetest-f8522d50e7c92438a3397d9965ac346613fbbfb9.zip
Fix server assert in case of invalid message from client, just kick that client.
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 29fb18112..7c4c48c48 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -1752,7 +1752,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
else if(command == TOSERVER_CLIENT_READY) {
// clients <= protocol version 22 did not send ready message,
// they're already initialized
- assert(peer_proto_ver > 22);
+ if (peer_proto_ver <= 22) {
+ infostream << "Client sent message not expected by a "
+ << "client using protocol version <= 22,"
+ << "disconnecing peer_id: " << peer_id << std::endl;
+ m_con.DisconnectPeer(peer_id);
+ return;
+ }
PlayerSAO* playersao = StageTwoClientInit(peer_id);