]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cmd.c
Call cvar callbacks after the cvar is set. Potentially fixes heap corruption.
[xonotic/darkplaces.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index f3d0a1cb1a5bbefeb92db6535b33eba2d03e4f3d..ea0b608eecfab77ade1a7bca311d3ce0ca4e85dc 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -410,6 +410,10 @@ static void Cmd_StuffCmds_f (cmd_state_t *cmd)
        int             i, j, l;
        // this is for all commandline options combined (and is bounds checked)
        char    build[MAX_INPUTLINE];
+       
+       // come back later so we don't crash
+       if(host.state == host_init)
+               return;
 
        if (Cmd_Argc (cmd) != 1)
        {
@@ -1516,12 +1520,9 @@ void Cmd_Init(void)
        // server commands received from clients have no reason to access cvars, cvar expansion seems perilous.
        cmd_serverfromclient.cvars = &cvars_null;
        cmd_serverfromclient.cvars_flagsmask = 0;
-       cmd_serverfromclient.cmd_flags = CMD_SERVER_FROM_CLIENT;
+       cmd_serverfromclient.cmd_flags = CMD_SERVER_FROM_CLIENT | CMD_USERINFO;
        cmd_serverfromclient.userdefined = &cmd_userdefined_null;
-}
 
-void Cmd_Init_Commands(qboolean dedicated_server)
-{
 //
 // register our commands
 //