added some checks to snap handling

(cherry picked from commit a09d498bc9)
This commit is contained in:
oy 2016-11-04 18:43:31 +01:00 committed by ChillerDragon
parent 77a4cd5b01
commit ef3bce204c
2 changed files with 3 additions and 2 deletions

View file

@ -1822,7 +1822,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
pData = (const char *)Unpacker.GetRaw(PartSize); 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; return;
if(GameTick >= m_CurrentRecvTick[g_Config.m_ClDummy]) if(GameTick >= m_CurrentRecvTick[g_Config.m_ClDummy])

View file

@ -33,7 +33,8 @@ public:
{ {
OFFSET_UUID_TYPE=0x4000, OFFSET_UUID_TYPE=0x4000,
MAX_TYPE=0x7fff, MAX_TYPE=0x7fff,
MAX_SIZE=64*1024 MAX_PARTS=64,
MAX_SIZE=MAX_PARTS*1024
}; };
void Clear() { m_DataSize = 0; m_NumItems = 0; } void Clear() { m_DataSize = 0; m_NumItems = 0; }