1
0
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:
Ivan Savenko 2024-02-19 13:46:07 +02:00
parent 81e44711a2
commit f620a07389

View File

@ -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),