mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
IniFile: Disallow section headers from starting at other line offsets than 0.
See #21479
This commit is contained in:
@@ -172,7 +172,10 @@ ParsedIniLine::ParsedIniLine(std::string_view line) {
|
||||
value.clear();
|
||||
comment = line;
|
||||
} else {
|
||||
ParseLine(line, &key, &value, &comment);
|
||||
if (!ParseLine(line, &key, &value, &comment)) {
|
||||
// Preserve bogus input but turn it into comments.
|
||||
comment = "# " + std::string(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,7 +476,7 @@ bool IniFile::Load(std::istream &in) {
|
||||
std::string linebuf;
|
||||
|
||||
while (std::getline(in, linebuf)) {
|
||||
std::string_view line = StripSpaces(std::string_view(linebuf));
|
||||
std::string_view line = std::string_view(linebuf);
|
||||
// Remove UTF-8 byte order marks.
|
||||
if (line.substr(0, 3) == "\xEF\xBB\xBF") {
|
||||
line = line.substr(3);
|
||||
|
||||
Reference in New Issue
Block a user