Skip to content

Commit f6144a2

Browse files
committed
Sanitize servercfgfile and lservercfgfile values with sm_cvar (bug 6579).
1 parent 9d7d00d commit f6144a2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugins/basecommands.sp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,16 @@ public Action Command_Cvar(int client, int args)
308308
}
309309

310310
GetCmdArg(2, value, sizeof(value));
311+
312+
// The server passes the values of these directly into ServerCommand, following exec. Sanitize.
313+
if (StrEqual(cvarname, "servercfgfile", false) || StrEqual(cvarname, "lservercfgfile", false))
314+
{
315+
int pos = StrContains(value, ";", true);
316+
if (pos != -1)
317+
{
318+
value[pos] = '\0';
319+
}
320+
}
311321

312322
if ((hndl.Flags & FCVAR_PROTECTED) != FCVAR_PROTECTED)
313323
{

0 commit comments

Comments
 (0)