diff options
author | Michael Lutz <michi@icosahedron.de> | 2019-05-22 21:06:03 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-05-23 00:08:39 +0200 |
commit | b73622a01ca5d2a72593c4f7ff985cfb5532cc0c (patch) | |
tree | ea92469fe019b88674f7bd444f704d95d1598dda /src | |
parent | c1d26d8884f92443b7fa94380881f794a402bba4 (diff) | |
download | openttd-b73622a01ca5d2a72593c4f7ff985cfb5532cc0c.tar.xz |
Fix #7600: Don't read uninitialised memory when parsing GS language files.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/game_text.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 412f2804f..b69b8f46b 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -111,7 +111,7 @@ std::unique_ptr<LanguageStrings> ReadRawLanguageStrings(const char *file) while (i > 0 && (buffer[i - 1] == '\r' || buffer[i - 1] == '\n' || buffer[i - 1] == ' ')) i--; buffer[i] = '\0'; - ret->lines.emplace_back(buffer, buffer + to_read - 1); + ret->lines.emplace_back(buffer, i); if (len > to_read) { to_read = 0; |