mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Add protocol validation
This commit is contained in:
		| @@ -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), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user