Fix off-by-one/buffer over-read error in StrMakeValid

See: https://github.com/OpenTTD/OpenTTD/issues/11644
This commit is contained in:
Jonathan G Rennison
2023-12-29 23:55:31 +00:00
parent 74a2cd5123
commit e62c912c10
2 changed files with 3 additions and 3 deletions

View File

@@ -290,7 +290,7 @@ void IniLoadFile::LoadFromDisk(const std::string &filename, Subdirectory subdir,
if (!quoted && e == t) {
item.value.reset();
} else {
item.value = StrMakeValid(std::string(t));
item.value = StrMakeValid(std::string_view(t));
}
} else {
/* it's an orphan item */