Skip to content

Commit f8522d5

Browse files
sapiersapier
sapier
authored and
sapier
committedJun 21, 2014
Fix server assert in case of invalid message from client, just kick that client.
1 parent 2b9beea commit f8522d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/server.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
17521752
else if(command == TOSERVER_CLIENT_READY) {
17531753
// clients <= protocol version 22 did not send ready message,
17541754
// they're already initialized
1755-
assert(peer_proto_ver > 22);
1755+
if (peer_proto_ver <= 22) {
1756+
infostream << "Client sent message not expected by a "
1757+
<< "client using protocol version <= 22,"
1758+
<< "disconnecing peer_id: " << peer_id << std::endl;
1759+
m_con.DisconnectPeer(peer_id);
1760+
return;
1761+
}
17561762

17571763
PlayerSAO* playersao = StageTwoClientInit(peer_id);
17581764

0 commit comments

Comments
 (0)
Please sign in to comment.