- Add parameter checking to CL_*Ping* functions.

- Remove unused CL_UpdateServerInfo function
This commit is contained in:
Thilo Schulz 2011-01-27 17:07:07 +00:00
parent 0c662f25f2
commit cd3e202fca

View file

@ -3783,9 +3783,9 @@ void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
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;
@ -3815,21 +3815,6 @@ void CL_GetPing( int n, char *buf, int buflen, int *pingtime )
*pingtime = time;
}
/*
==================
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
@ -3837,9 +3822,9 @@ 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;