mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 14:52:00 +00:00
- Add parameter checking to CL_*Ping* functions.
- Remove unused CL_UpdateServerInfo function
This commit is contained in:
parent
0c662f25f2
commit
cd3e202fca
1 changed files with 4 additions and 19 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue