[quake3-commits] r1866 - trunk/code/game

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Feb 6 15:35:46 EST 2011


Author: thilo
Date: 2011-02-06 15:35:46 -0500 (Sun, 06 Feb 2011)
New Revision: 1866

Modified:
   trunk/code/game/g_main.c
Log:
Fix buffer overflow, reported by Mads Lind


Modified: trunk/code/game/g_main.c
===================================================================
--- trunk/code/game/g_main.c	2011-02-06 20:26:18 UTC (rev 1865)
+++ trunk/code/game/g_main.c	2011-02-06 20:35:46 UTC (rev 1866)
@@ -765,9 +765,10 @@
 	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;



More information about the quake3-commits mailing list