diff options
author | truelight <truelight@openttd.org> | 2004-11-20 11:15:31 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-11-20 11:15:31 +0000 |
commit | 32f69dab0e09d902a73990acdc74d36180b67993 (patch) | |
tree | 4b62ad10be16149cdf304e65811acf6c34272a26 | |
parent | 578bde9aaef23287b43286878ea9c54b873e362c (diff) | |
download | openttd-32f69dab0e09d902a73990acdc74d36180b67993.tar.xz |
(svn r702) -Fix: Buffer overflow in music/sound/video-driver-parameter (Oskar_)
-rw-r--r-- | ttd.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -480,7 +480,7 @@ int ttd_main(int argc, char* argv[]) int network = 0; char *network_conn = NULL; char *language = NULL; - char musicdriver[32], sounddriver[32], videodriver[32]; + char musicdriver[16], sounddriver[16], videodriver[16]; int resolution[2] = {0,0}; uint startdate = -1; _ignore_wrong_grf = false; @@ -549,9 +549,9 @@ int ttd_main(int argc, char* argv[]) LoadFromConfig(); // override config? - if (musicdriver[0]) strcpy(_ini_musicdriver, musicdriver); - if (sounddriver[0]) strcpy(_ini_sounddriver, sounddriver); - if (videodriver[0]) strcpy(_ini_videodriver, videodriver); + if (musicdriver[0]) ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver)); + if (sounddriver[0]) ttd_strlcpy(_ini_sounddriver, sounddriver, sizeof(_ini_sounddriver)); + if (videodriver[0]) ttd_strlcpy(_ini_videodriver, videodriver, sizeof(_ini_videodriver)); if (resolution[0]) { _cur_resolution[0] = resolution[0]; _cur_resolution[1] = resolution[1]; } if (startdate != -1) _patches.starting_date = startdate; |