mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Disallow compressed control messages
This commit is contained in:
parent
5b19be992d
commit
884ad25204
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue