Protocol 1.8: Fixed possible crash on malformed packet.
This commit is contained in:
parent
5a44be13b7
commit
f8c627141a
@ -1713,6 +1713,11 @@ void cProtocol180::AddReceivedData(const char * a_Data, size_t a_Size)
|
||||
{
|
||||
UInt32 NumBytesRead = m_ReceivedData.GetReadableSpace();
|
||||
m_ReceivedData.ReadVarInt(CompressedSize);
|
||||
if (CompressedSize > PacketLen)
|
||||
{
|
||||
m_Client->Kick("Bad compression");
|
||||
return;
|
||||
}
|
||||
if (CompressedSize > 0)
|
||||
{
|
||||
// Decompress the data:
|
||||
|
Loading…
Reference in New Issue
Block a user