Fix stack buffer over-read in ReadRawLanguageStrings

This commit is contained in:
Jonathan G Rennison 2019-05-22 07:20:07 +01:00
parent f3aff0fd7f
commit bf73535eed

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, buffer + i);
if (len > to_read) {
to_read = 0;