summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-31 16:14:46 +0100
committeraap <aap@papnet.eu>2020-12-31 16:14:46 +0100
commit1a8a1c91cb30d592e8f46c9b45f663e2ad82ed5c (patch)
treef75939f8b4b19773c22d6482237f1080481fe907
parentfix use of LoadFile (diff)
downloadre3-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
Diffstat (limited to '')
-rw-r--r--src/weapons/Explosion.cpp5
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;