added some checks to snap handling

This commit is contained in:
oy 2016-11-04 18:43:31 +01:00
parent 0a8ce055cd
commit a09d498bc9
2 changed files with 3 additions and 2 deletions

View file

@ -1234,7 +1234,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
pData = (const char *)Unpacker.GetRaw(PartSize);
if(Unpacker.Error())
if(Unpacker.Error() || NumParts < 1 || NumParts > CSnapshot::MAX_PARTS || Part < 0 | Part >= NumParts || PartSize < 0 || PartSize > MAX_SNAPSHOT_PACKSIZE)
return;
if(GameTick >= m_CurrentRecvTick)

View file

@ -31,7 +31,8 @@ class CSnapshot
public:
enum
{
MAX_SIZE=64*1024
MAX_PARTS = 64,
MAX_SIZE = MAX_PARTS*1024
};
void Clear() { m_DataSize = 0; m_NumItems = 0; }