Fix buffer overflow, reported by Mads Lind

This commit is contained in:
Thilo Schulz 2011-02-06 20:35:46 +00:00
parent 0e6427f3ff
commit a2715bc283

View file

@ -765,9 +765,10 @@ void CalculateRanks( void ) {
level.numNonSpectatorClients = 0; level.numNonSpectatorClients = 0;
level.numPlayingClients = 0; level.numPlayingClients = 0;
level.numVotingClients = 0; // don't count bots 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; level.numteamVotingClients[i] = 0;
}
for ( i = 0 ; i < level.maxclients ; i++ ) { for ( i = 0 ; i < level.maxclients ; i++ ) {
if ( level.clients[i].pers.connected != CON_DISCONNECTED ) { if ( level.clients[i].pers.connected != CON_DISCONNECTED ) {
level.sortedClients[level.numConnectedClients] = i; level.sortedClients[level.numConnectedClients] = i;