mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
added some checks to snap handling
This commit is contained in:
parent
0a8ce055cd
commit
a09d498bc9
|
@ -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)
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue