mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Fix stack buffer over-read in ReadRawLanguageStrings
This commit is contained in:
parent
f3aff0fd7f
commit
bf73535eed
@ -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, buffer + i);
|
||||
|
||||
if (len > to_read) {
|
||||
to_read = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user