Fix #11644: Off by one error/buffer over-read in StrMakeValid (#11645)

* Fix #11644: Off by one error in StrMakeValid UTF-8 decode overrun detection

* Fix #11644: Off by one error in StrMakeValid buffer last character

* Fix: Unnecessary string duplication at StrMakeValid call sites
This commit is contained in:
Jonathan G Rennison
2024-01-01 18:26:31 +00:00
committed by GitHub
parent a672813bb0
commit 88324a253e
3 changed files with 6 additions and 4 deletions

View File

@@ -284,7 +284,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 */