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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Oct 25 02:39:11 EDT 2010


Author: zakk
Date: 2010-10-25 02:39:11 -0400 (Mon, 25 Oct 2010)
New Revision: 1801

Modified:
   trunk/code/game/g_arenas.c
Log:
Bugzilla #4753
Potential buffer overflow in UpdateTournamentInfo()


Modified: trunk/code/game/g_arenas.c
===================================================================
--- trunk/code/game/g_arenas.c	2010-10-25 06:34:33 UTC (rev 1800)
+++ trunk/code/game/g_arenas.c	2010-10-25 06:39:11 UTC (rev 1801)
@@ -42,7 +42,6 @@
 	gentity_t	*player;
 	int			playerClientNum;
 	int			n, accuracy, perfect,	msglen;
-	int			buflen;
 #ifdef MISSIONPACK
   int score1, score2;
 	qboolean won;
@@ -126,8 +125,8 @@
 	for( i = 0; i < level.numNonSpectatorClients; i++ ) {
 		n = level.sortedClients[i];
 		Com_sprintf( buf, sizeof(buf), " %i %i %i", n, level.clients[n].ps.persistant[PERS_RANK], level.clients[n].ps.persistant[PERS_SCORE] );
-		buflen = strlen( buf );
-		if( msglen + buflen + 1 >= sizeof(msg) ) {
+		msglen += strlen( buf );
+		if( msglen >= sizeof(msg) ) {
 			break;
 		}
 		strcat( msg, buf );



More information about the quake3-commits mailing list