mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
added some checks to snap handling
(cherry picked from commit a09d498bc9
)
This commit is contained in:
parent
77a4cd5b01
commit
ef3bce204c
|
@ -1822,7 +1822,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
|
|||
|
||||
pData = (const char *)Unpacker.GetRaw(PartSize);
|
||||
|
||||
if(Unpacker.Error() || NumParts < 1 || Part < 0 || PartSize < 0)
|
||||
if(Unpacker.Error() || NumParts < 1 || NumParts > CSnapshot::MAX_PARTS || Part < 0 | Part >= NumParts || PartSize < 0 || PartSize > MAX_SNAPSHOT_PACKSIZE)
|
||||
return;
|
||||
|
||||
if(GameTick >= m_CurrentRecvTick[g_Config.m_ClDummy])
|
||||
|
|
|
@ -33,7 +33,8 @@ public:
|
|||
{
|
||||
OFFSET_UUID_TYPE=0x4000,
|
||||
MAX_TYPE=0x7fff,
|
||||
MAX_SIZE=64*1024
|
||||
MAX_PARTS=64,
|
||||
MAX_SIZE=MAX_PARTS*1024
|
||||
};
|
||||
|
||||
void Clear() { m_DataSize = 0; m_NumItems = 0; }
|
||||
|
|
Loading…
Reference in a new issue