Browse Source

engine: server: return NULL in SV_ClientBy{Id,Name} if client array isn't allocated

master
Alibek Omarov 10 months ago
parent
commit
2c0d6e06be
  1. 4
      engine/server/sv_client.c

4
engine/server/sv_client.c

@ -799,7 +799,7 @@ sv_client_t *SV_ClientById( int id )
ASSERT( id >= 0 ); ASSERT( id >= 0 );
for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ ) for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
{ {
if( !cl->state ) if( !cl->state )
continue; continue;
@ -819,7 +819,7 @@ sv_client_t *SV_ClientByName( const char *name )
if( !COM_CheckString( name )) if( !COM_CheckString( name ))
return NULL; return NULL;
for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ ) for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
{ {
if( !cl->state ) if( !cl->state )
continue; continue;

Loading…
Cancel
Save