From 0d2a8488ae56fbc672630b19f77486752ed879d7 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 4 Nov 2024 13:16:39 +0300 Subject: [PATCH] engine: client: replace illegal for infostring characters in server info got from TSource Engine Query --- engine/client/cl_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 2790182a..f30321d1 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -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 );