diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_client.c | 7 | ||||
-rw-r--r-- | src/qcommon/q_shared.c | 20 |
2 files changed, 21 insertions, 6 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c index 7246a25a..912e9dd9 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -996,7 +996,12 @@ void ClientUserinfoChanged( int clientNum ) // check for malformed or illegal info strings if( !Info_Validate(userinfo) ) - strcpy( userinfo, "\\name\\badinfo" ); + { + trap_SendServerCommand( ent - g_entities, + "disconnect \"illegal or malformed userinfo\n\"" ); + trap_DropClient( ent - g_entities, + "dropped: illegal or malformed userinfo"); + } // stickyspec toggle s = Info_ValueForKey( userinfo, "cg_stickySpec" ); diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index fc259219..07e3669c 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -1234,12 +1234,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; } |