Disallow compressed control messages

This commit is contained in:
heinrich5991 2016-08-12 18:41:03 +02:00
parent 5b19be992d
commit 884ad25204

View file

@ -211,7 +211,14 @@ int CNetBase::UnpackPacket(unsigned char *pBuffer, int Size, CNetPacketConstruct
else else
{ {
if(pPacket->m_Flags&NET_PACKETFLAG_COMPRESSION) if(pPacket->m_Flags&NET_PACKETFLAG_COMPRESSION)
{
// Don't allow compressed control packets.
if(pPacket->m_Flags&NET_PACKETFLAG_CONTROL)
{
return -1;
}
pPacket->m_DataSize = ms_Huffman.Decompress(&pBuffer[3], pPacket->m_DataSize, pPacket->m_aChunkData, sizeof(pPacket->m_aChunkData)); pPacket->m_DataSize = ms_Huffman.Decompress(&pBuffer[3], pPacket->m_DataSize, pPacket->m_aChunkData, sizeof(pPacket->m_aChunkData));
}
else else
mem_copy(pPacket->m_aChunkData, &pBuffer[3], pPacket->m_DataSize); mem_copy(pPacket->m_aChunkData, &pBuffer[3], pPacket->m_DataSize);
} }