diff options
author | aap <aap@papnet.eu> | 2020-12-31 16:14:46 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-12-31 16:14:46 +0100 |
commit | 1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c (patch) | |
tree | f75939f8b4b19773c22d6482237f1080481fe907 | |
parent | fix use of LoadFile (diff) | |
download | re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.tar re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.tar.gz re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.tar.bz2 re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.tar.lz re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.tar.xz re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.tar.zst re3-1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c.zip |
-rw-r--r-- | src/weapons/Explosion.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp index d0a68279..8ab81748 100644 --- a/src/weapons/Explosion.cpp +++ b/src/weapons/Explosion.cpp @@ -104,7 +104,12 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT #endif 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)) +#endif n++; if (n == ARRAY_SIZE(gaExplosion)) return false; |