summaryrefslogtreecommitdiff
path: root/src/console.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-06 01:23:25 +0000
committerrubidium <rubidium@openttd.org>2009-03-06 01:23:25 +0000
commit34bd9ee636b43d1851d27f92884769f8f25717be (patch)
tree8972c2c7b9b1ab7c2b41b46cd9a44f1bb0fbd9bd /src/console.cpp
parent9c6d6c0d0edba265c73c04901d0f2155173407b8 (diff)
downloadopenttd-34bd9ee636b43d1851d27f92884769f8f25717be.tar.xz
(svn r15626) -Fix [FS#2698]: UTF8 string handling could cause buffer overruns.
Diffstat (limited to 'src/console.cpp')
-rw-r--r--src/console.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/console.cpp b/src/console.cpp
index 5cd5504b9..a113abf86 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -97,7 +97,7 @@ void IConsolePrint(ConsoleColour colour_code, const char *string)
* characters and (when applicable) assign it to the console buffer */
str = strdup(string);
str_strip_colours(str);
- str_validate(str);
+ str_validate(str, str + strlen(str));
if (_network_dedicated) {
fprintf(stdout, "%s\n", str);