Skip to content

Commit

Permalink
fix overflow in CG_ParseTeamInfo
Browse files Browse the repository at this point in the history
based on patch for Tremulous, thanks to Roman Tetelman
  • Loading branch information
lnussel committed Jan 13, 2009
1 parent a1f9885 commit cde5fcf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/cgame/cg_servercmds.c
Expand Up @@ -118,9 +118,20 @@ static void CG_ParseTeamInfo( void ) {
int client;

numSortedTeamPlayers = atoi( CG_Argv( 1 ) );
if( numSortedTeamPlayers < 0 || numSortedTeamPlayers > TEAM_MAXOVERLAY )
{
CG_Error( "CG_ParseTeamInfo: numSortedTeamPlayers out of range (%d)",
numSortedTeamPlayers );
return;
}

for ( i = 0 ; i < numSortedTeamPlayers ; i++ ) {
client = atoi( CG_Argv( i * 6 + 2 ) );
if( client < 0 || client >= MAX_CLIENTS )
{
CG_Error( "CG_ParseTeamInfo: bad client number: %d", client );
return;
}

sortedTeamPlayers[i] = client;

Expand Down

0 comments on commit cde5fcf

Please sign in to comment.