From 4bf72b5383992aa4f0c2fc6489c94e6d979a2045 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 25 May 2024 02:26:32 +0300 Subject: [PATCH] engine: forbid accessing cvars starting with con_ and scr_ through stufftext Some stupid servers might mess up with console cvars values. --- engine/common/cmd.c | 2 +- engine/common/cvar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 38fd1b92..1e8837b3 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -949,7 +949,7 @@ static void Cmd_Else_f( void ) static qboolean Cmd_ShouldAllowCommand( cmd_t *cmd, qboolean isPrivileged ) { - const char *prefixes[] = { "cl_", "gl_", "r_", "m_", "hud_", "joy_" }; + const char *prefixes[] = { "cl_", "gl_", "r_", "m_", "hud_", "joy_", "con_", "scr_" }; int i; // always allow local commands diff --git a/engine/common/cvar.c b/engine/common/cvar.c index eec96985..c72e2274 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -955,7 +955,7 @@ static void Cvar_SetGL( const char *name, const char *value ) static qboolean Cvar_ShouldSetCvar( convar_t *v, qboolean isPrivileged ) { - const char *prefixes[] = { "cl_", "gl_", "m_", "r_", "hud_", "joy_" }; + const char *prefixes[] = { "cl_", "gl_", "m_", "r_", "hud_", "joy_", "con_", "scr_" }; int i; if( isPrivileged )