1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

Fix #7600: Don't read uninitialised memory when parsing GS language files.

This commit is contained in:
Michael Lutz
2019-05-22 21:06:03 +02:00
parent c1d26d8884
commit b73622a01c

View File

@@ -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;