mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-08-22 14:22:58 +02:00
fix UB
This commit is contained in:
@@ -104,7 +104,12 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
while (n < ARRAY_SIZE(gaExplosion) && gaExplosion[n].m_nIteration != 0)
|
||||||
|
#else
|
||||||
|
// array overrun is UB
|
||||||
while (gaExplosion[n].m_nIteration != 0 && n < ARRAY_SIZE(gaExplosion))
|
while (gaExplosion[n].m_nIteration != 0 && n < ARRAY_SIZE(gaExplosion))
|
||||||
|
#endif
|
||||||
n++;
|
n++;
|
||||||
if (n == ARRAY_SIZE(gaExplosion))
|
if (n == ARRAY_SIZE(gaExplosion))
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user