From 059e40e2d52cb201609f78c1520f14c53093f2bd Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 7 Jan 2018 15:04:50 +0200 Subject: [PATCH] Prohibited setting of non-mod CVARs from unsafe alias --- src/c_dispatch.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index b8e221e389..73d0d5d3e6 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -651,6 +651,12 @@ void C_DoCommand (const char *cmd, int keynum) if (args.argc() >= 2) { // Set the variable + if (UnsafeExecutionContext && !(var->GetFlags() & CVAR_MOD)) + { + Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", var->GetName()); + return; + } + var->CmdSet (args[1]); } else