From f25a5ea2bc4b42312a477ce261e95a93586379c5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 7 Jan 2018 15:03:49 +0200 Subject: [PATCH] Marked a few commands as unsafe This process of finding unsafe commands is not complete! --- src/c_cmds.cpp | 10 +++++----- src/c_console.cpp | 2 +- src/d_main.cpp | 4 ++-- src/g_level.cpp | 2 +- src/m_misc.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index 748680e91..e3e87595d 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -467,7 +467,7 @@ CCMD (print) } } -CCMD (exec) +UNSAFE_CCMD (exec) { if (argv.argc() < 2) return; @@ -495,7 +495,7 @@ void execLogfile(const char *fn, bool append) } } -CCMD (logfile) +UNSAFE_CCMD (logfile) { if (Logfile) @@ -651,7 +651,7 @@ CCMD (error) } } -CCMD (error_fatal) +UNSAFE_CCMD (error_fatal) { if (argv.argc() > 1) { @@ -794,7 +794,7 @@ CCMD (warp) // //========================================================================== -CCMD (load) +UNSAFE_CCMD (load) { if (argv.argc() != 2) { @@ -819,7 +819,7 @@ CCMD (load) // //========================================================================== -CCMD (save) +UNSAFE_CCMD (save) { if (argv.argc() < 2 || argv.argc() > 3) { diff --git a/src/c_console.cpp b/src/c_console.cpp index c3ab76903..9cbb5623f 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -627,7 +627,7 @@ void C_InitConsole (int width, int height, bool ingame) // //========================================================================== -CCMD (atexit) +UNSAFE_CCMD (atexit) { if (argv.argc() == 1) { diff --git a/src/d_main.cpp b/src/d_main.cpp index 656a2ca3b..92e10903f 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2821,7 +2821,7 @@ void D_DoomMain (void) // //========================================================================== -CCMD(restart) +UNSAFE_CCMD(restart) { // remove command line args that would get in the way during restart Args->RemoveArgs("-iwad"); @@ -2917,4 +2917,4 @@ CUSTOM_CVAR(Bool, I_FriendlyWindowTitle, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CV I_SetWindowTitle(DoomStartupInfo.Name.GetChars()); else I_SetWindowTitle(NULL); -} \ No newline at end of file +} diff --git a/src/g_level.cpp b/src/g_level.cpp index ce8ff0850..b427599f0 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -277,7 +277,7 @@ CCMD(recordmap) // //========================================================================== -CCMD (open) +UNSAFE_CCMD (open) { if (netgame) { diff --git a/src/m_misc.cpp b/src/m_misc.cpp index 8fcaf9e0c..eb51ec7b9 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -315,7 +315,7 @@ void M_SaveDefaultsFinal () GameConfig = NULL; } -CCMD (writeini) +UNSAFE_CCMD (writeini) { const char *filename = (argv.argc() == 1) ? NULL : argv[1]; if (!M_SaveDefaults (filename))