mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Add protocol validation
This commit is contained in:
parent
81e44711a2
commit
f620a07389
@ -49,6 +49,12 @@ void NetworkConnection::onHeaderReceived(const boost::system::error_code & ecHea
|
||||
return;
|
||||
}
|
||||
|
||||
if (messageSize == 0)
|
||||
{
|
||||
listener.onDisconnected(shared_from_this(), "Zero-sized packet!");
|
||||
return;
|
||||
}
|
||||
|
||||
boost::asio::async_read(*socket,
|
||||
readBuffer,
|
||||
boost::asio::transfer_exactly(messageSize),
|
||||
|
Loading…
Reference in New Issue
Block a user