2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 01:45:19 +01:00

engine: client: replace illegal for infostring characters in server info got from TSource Engine Query

This commit is contained in:
Alibek Omarov 2024-11-04 13:16:39 +03:00
parent a52c8aa291
commit 0d2a8488ae

View File

@ -2017,6 +2017,7 @@ static void CL_ParseGoldSrcStatusMessage( netadr_t from, sizebuf_t *msg )
int p, numcl, maxcl, password, remaining;
string host, map, gamedir, version;
connprotocol_t proto;
char *replace;
// set to beginning but skip header
MSG_SeekToBit( msg, (sizeof( uint32_t ) + sizeof( uint8_t )) << 3, SEEK_SET );
@ -2078,6 +2079,12 @@ static void CL_ParseGoldSrcStatusMessage( netadr_t from, sizebuf_t *msg )
Con_Printf( S_ERROR "%s: infostring overflow!\n", __func__ );
return;
}
while(( replace = Q_strpbrk( host, "\\\"" )))
{
*replace = ' '; // find a better replacement?
}
Info_SetValueForKey( s, "host", host, sizeof( s ));
UI_AddServerToList( from, s );