summaryrefslogtreecommitdiff
path: root/src/os/windows/win32.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2015-05-20 18:18:26 +0000
committerrubidium <rubidium@openttd.org>2015-05-20 18:18:26 +0000
commit10466746b4083d93af547c153db3730e74c8a3a2 (patch)
tree8b316537337fedf6d7f8cfef7e5374cbc58520e5 /src/os/windows/win32.cpp
parentd05ac99d52e8051a5ec75393863b44cca17306b3 (diff)
downloadopenttd-10466746b4083d93af547c153db3730e74c8a3a2.tar.xz
(svn r27290) -Fix: sanitize the command line arguments before doing anything complex with them
Diffstat (limited to 'src/os/windows/win32.cpp')
-rw-r--r--src/os/windows/win32.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 3d5f0ebde..f69f01f6c 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -453,6 +453,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
argc = ParseCommandLine(cmdline, argv, lengthof(argv));
+ /* Make sure our arguments contain only valid UTF-8 characters. */
+ for (int i = 0; i < argc; i++) ValidateString(argv[i]);
+
openttd_main(argc, argv);
free(cmdline);
return 0;