From: Dale Weiler Date: Sat, 22 Jun 2013 01:58:20 +0000 (+0000) Subject: Buffer overflow! X-Git-Tag: v0.3.0~83 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=560b45dd1645eb8086ded0eab0ab19476fe82ed8;p=xonotic%2Fgmqcc.git Buffer overflow! --- diff --git a/util.c b/util.c index b34460d..15ccd25 100644 --- 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];