[quake3-commits] r1828 - trunk/code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jan 27 12:07:08 EST 2011


Author: thilo
Date: 2011-01-27 12:07:07 -0500 (Thu, 27 Jan 2011)
New Revision: 1828

Modified:
   trunk/code/client/cl_main.c
Log:
- Add parameter checking to CL_*Ping* functions.
- Remove unused CL_UpdateServerInfo function


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2011-01-27 16:41:08 UTC (rev 1827)
+++ trunk/code/client/cl_main.c	2011-01-27 17:07:07 UTC (rev 1828)
@@ -3783,9 +3783,9 @@
 	int		time;
 	int		maxPing;
 
-	if (!cl_pinglist[n].adr.port)
+	if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
 	{
-		// empty slot
+		// empty or invalid slot
 		buf[0]    = '\0';
 		*pingtime = 0;
 		return;
@@ -3817,29 +3817,14 @@
 
 /*
 ==================
-CL_UpdateServerInfo
-==================
-*/
-void CL_UpdateServerInfo( int n )
-{
-	if (!cl_pinglist[n].adr.port)
-	{
-		return;
-	}
-
-	CL_SetServerInfoByAddress(cl_pinglist[n].adr, cl_pinglist[n].info, cl_pinglist[n].time );
-}
-
-/*
-==================
 CL_GetPingInfo
 ==================
 */
 void CL_GetPingInfo( int n, char *buf, int buflen )
 {
-	if (!cl_pinglist[n].adr.port)
+	if (n < 0 || n >= MAX_PINGREQUESTS || !cl_pinglist[n].adr.port)
 	{
-		// empty slot
+		// empty or invalid slot
 		if (buflen)
 			buf[0] = '\0';
 		return;



More information about the quake3-commits mailing list