fix buffer overflow in CalculateRanks()

from Thilo Schulz in ioquake3
svn 1866 git a2715bc2831ca32605f0722b34666106a2a4fc27

Fix buffer overflow, reported by Mads Lind
This commit is contained in:
Jonathan Gray 2013-05-07 19:49:22 +10:00
parent 3fa32e5910
commit df117b922f

View file

@ -1759,9 +1759,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;