r1492 - trunk/code/cgame

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Jan 13 02:57:03 EST 2009


Author: ludwig
Date: 2009-01-13 02:57:03 -0500 (Tue, 13 Jan 2009)
New Revision: 1492

Modified:
   trunk/code/cgame/cg_servercmds.c
Log:
fix overflow in CG_ParseTeamInfo

based on patch for Tremulous, thanks to Roman Tetelman

Modified: trunk/code/cgame/cg_servercmds.c
===================================================================
--- trunk/code/cgame/cg_servercmds.c	2009-01-13 07:57:01 UTC (rev 1491)
+++ trunk/code/cgame/cg_servercmds.c	2009-01-13 07:57:03 UTC (rev 1492)
@@ -118,9 +118,20 @@
 	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;
 




More information about the quake3-commits mailing list