summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-07-28 15:17:47 +0000
committersmatz <smatz@openttd.org>2008-07-28 15:17:47 +0000
commit686019398f20ee51ea9a9ff31cafde3977d443b5 (patch)
tree900ab95dd6ab6b52e8d8ae8750c2df0a3abeb025
parent81dafb5e6921744e373162b8c52328dfdc59bc07 (diff)
downloadopenttd-686019398f20ee51ea9a9ff31cafde3977d443b5.tar.xz
(svn r13858) -Fix: buffer overflow for too long filename supplied as '-g' parameter
-rw-r--r--src/openttd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 29c230c8e..7eb61c226 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -458,7 +458,7 @@ int ttd_main(int argc, char *argv[])
case 'i': _use_dos_palette = true; break;
case 'g':
if (mgo.opt != NULL) {
- strcpy(_file_to_saveload.name, mgo.opt);
+ ttd_strlcpy(_file_to_saveload.name, mgo.opt, sizeof(_file_to_saveload.name));
_switch_mode = SM_LOAD;
} else {
_switch_mode = SM_NEWGAME;