engine: server: prevent DoS through master server query

This commit is contained in:
Alibek Omarov 2022-08-17 21:23:08 +03:00
parent b3c9637422
commit 0d2552c3f6
1 changed files with 6 additions and 0 deletions

View File

@ -772,6 +772,12 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
int clients = 0, bots = 0;
int len = sizeof( s );
if( !NET_IsMasterAdr( from ))
{
Con_Printf( S_WARN "unexpected master server info query packet from %s\n", NET_AdrToString( from ));
return;
}
clients = SV_GetConnectedClientsCount( &bots );
challenge = MSG_ReadUBitLong( msg, sizeof( uint ) << 3 );