Fix a possible out-of-bounds read in snapshot.cpp

This commit is contained in:
heinrich5991 2017-05-27 15:52:05 +02:00
parent 555e8fe889
commit 3b88d78736

View file

@ -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
{