Sanitize servercfgfile and lservercfgfile values with sm_cvar (bug 6579).
This commit is contained in:
parent
3fd7b29d64
commit
c7f413f1b0
@ -309,6 +309,16 @@ public Action Command_Cvar(int client, int args)
|
|||||||
|
|
||||||
GetCmdArg(2, value, sizeof(value));
|
GetCmdArg(2, value, sizeof(value));
|
||||||
|
|
||||||
|
// The server passes the values of these directly into ServerCommand, following exec. Sanitize.
|
||||||
|
if (StrEqual(cvarname, "servercfgfile", false) || StrEqual(cvarname, "lservercfgfile", false))
|
||||||
|
{
|
||||||
|
int pos = StrContains(value, ";", true);
|
||||||
|
if (pos != -1)
|
||||||
|
{
|
||||||
|
value[pos] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((hndl.Flags & FCVAR_PROTECTED) != FCVAR_PROTECTED)
|
if ((hndl.Flags & FCVAR_PROTECTED) != FCVAR_PROTECTED)
|
||||||
{
|
{
|
||||||
ShowActivity2(client, "[SM] ", "%t", "Cvar changed", cvarname, value);
|
ShowActivity2(client, "[SM] ", "%t", "Cvar changed", cvarname, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user