]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - util.c
Buffer overflow!
[xonotic/gmqcc.git] / util.c
diff --git a/util.c b/util.c
index b34460d97b63dd983d5e8e5b00161a31512583ec..15ccd25e90ef56620f31170d0e3f5e62b87e1444 100644 (file)
--- a/util.c
+++ b/util.c
@@ -425,7 +425,7 @@ static GMQCC_INLINE void mt_generate(void) {
      * Said loop has been unrolled for MT_SPACE (226 iterations), opposed
      * to [0, MT_SIZE)  (634 iterations).
      */
-    for (i = 0; i < MT_SPACE; ++i) {
+    for (i = 0; i < MT_SPACE-1; ++i) {
         y           = (0x80000000 & mt_state[i]) | (0x7FFFFFF & mt_state[i + 1]);
         mt_state[i] = mt_state[i + MT_PERIOD] ^ (y >> 1) ^ matrix[y & 1];