summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-26 20:55:08 +0000
committerrubidium <rubidium@openttd.org>2014-04-26 20:55:08 +0000
commit77889ab8e80653cb09cfc25b1d918b3562f1eab9 (patch)
tree37b059e99ffb44b601e5c28b084227c14dd7abab
parent157e45f8d177c23b52119c08067faa06b8d71942 (diff)
downloadopenttd-77889ab8e80653cb09cfc25b1d918b3562f1eab9.tar.xz
(svn r26521) -Fix-ish: prevent from ever reading huge (or negative) amounts of data in strgen
-rw-r--r--src/strgen/strgen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 606f82518..85b83f2b5 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -124,7 +124,7 @@ struct FileStringReader : StringReader {
/* virtual */ char *ReadLine(char *buffer, const char *last)
{
- return fgets(buffer, last - buffer + 1, this->fh);
+ return fgets(buffer, ClampToU16(last - buffer + 1), this->fh);
}
/* virtual */ void HandlePragma(char *str);