diff --git a/src/engine/shared/snapshot.cpp b/src/engine/shared/snapshot.cpp index 4e6331c90..32efb71fd 100644 --- a/src/engine/shared/snapshot.cpp +++ b/src/engine/shared/snapshot.cpp @@ -4,6 +4,8 @@ #include "compression.h" #include "uuid_manager.h" +#include + #include #include @@ -380,6 +382,8 @@ int CSnapshotDelta::UnpackDelta(CSnapshot *pFrom, CSnapshot *pTo, const void *pS { if(pData + 1 > pEnd) return -2; + if(*pData < 0 || *pData > INT_MAX / 4) + return -3; ItemSize = (*pData++) * 4; }