]> 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 f7d84dc2c21f55023b5d270c54b460dc59c09714..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,7 +1520,7 @@ 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;
 
 //