From a2715bc2831ca32605f0722b34666106a2a4fc27 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sun, 6 Feb 2011 20:35:46 +0000 Subject: [PATCH] Fix buffer overflow, reported by Mads Lind --- code/game/g_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/g_main.c b/code/game/g_main.c index 583479b3..41fa3fe9 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -765,9 +765,10 @@ void CalculateRanks( void ) { level.numNonSpectatorClients = 0; level.numPlayingClients = 0; level.numVotingClients = 0; // don't count bots - for ( i = 0; i < TEAM_NUM_TEAMS; i++ ) { + + for (i = 0; i < ARRAY_LEN(level.numteamVotingClients); i++) level.numteamVotingClients[i] = 0; - } + for ( i = 0 ; i < level.maxclients ; i++ ) { if ( level.clients[i].pers.connected != CON_DISCONNECTED ) { level.sortedClients[level.numConnectedClients] = i;