File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Generals/Code/GameEngine/Source/GameLogic/Map
GeneralsMD/Code/GameEngine/Source/GameLogic/Map Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ void PolygonTrigger::reallocate(void)
95
95
{
96
96
DEBUG_ASSERTCRASH (m_numPoints <= m_sizePoints, (" Invalid m_numPoints." ));
97
97
if (m_numPoints == m_sizePoints) {
98
+ if (m_sizePoints > INT_MAX / 2 ) {
99
+ DEBUG_CRASH ((" Too many points to allocate." ));
100
+ return ;
101
+ }
98
102
// Reallocate.
99
103
m_sizePoints += m_sizePoints;
100
104
ICoord3D *newPts = NEW ICoord3D[m_sizePoints];
Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ void PolygonTrigger::reallocate(void)
97
97
{
98
98
DEBUG_ASSERTCRASH (m_numPoints <= m_sizePoints, (" Invalid m_numPoints." ));
99
99
if (m_numPoints == m_sizePoints) {
100
+ if (m_sizePoints > INT_MAX / 2 ) {
101
+ DEBUG_CRASH ((" Too many points to allocate." ));
102
+ return ;
103
+ }
100
104
// Reallocate.
101
105
m_sizePoints += m_sizePoints;
102
106
ICoord3D *newPts = NEW ICoord3D[m_sizePoints];
You can’t perform that action at this time.
0 commit comments