mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Fix a possible out-of-bounds read in snapshot.cpp
This commit is contained in:
parent
555e8fe889
commit
3b88d78736
|
@ -359,7 +359,7 @@ int CSnapshotDelta::UnpackDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pSrcData
|
|||
|
||||
Type = *pData++;
|
||||
ID = *pData++;
|
||||
if ((unsigned int)Type < sizeof(m_aItemSizes) && m_aItemSizes[Type])
|
||||
if ((unsigned int)Type < sizeof(m_aItemSizes) / sizeof(m_aItemSizes[0]) && m_aItemSizes[Type])
|
||||
ItemSize = m_aItemSizes[Type];
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue