From a6f949c8a659d9f4c5b347981e29699fdad7c9e4 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 6 Oct 2025 18:27:00 +0100 Subject: [PATCH] Stricter Info_Validate --- code/qcommon/q_shared.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/code/qcommon/q_shared.c b/code/qcommon/q_shared.c index e75fa2f0..37f2ec05 100644 --- a/code/qcommon/q_shared.c +++ b/code/qcommon/q_shared.c @@ -1301,12 +1301,22 @@ can mess up the server's parsing ================== */ qboolean Info_Validate( const char *s ) { - if ( strchr( s, '\"' ) ) { - return qfalse; - } - if ( strchr( s, ';' ) ) { - return qfalse; + const char* ch = s; + + while ( *ch != '\0' ) + { + if( !Q_isprint( *ch ) ) + return qfalse; + + if( *ch == '\"' ) + return qfalse; + + if( *ch == ';' ) + return qfalse; + + ++ch; } + return qtrue; }