mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-09 21:40:10 +00:00
IniFile: Prevent potential out-of-bounds access in ParseLine()
While current usages of ParseLine aren't problematic, this is still a public function that can be used for other purposes. Essentially makes the function handle potential external inputs a little nicer.
This commit is contained in:
parent
e2c769a9c5
commit
2ae370fc37
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut)
|
void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut)
|
||||||
{
|
{
|
||||||
if (line[0] == '#')
|
if (line.empty() || line.front() == '#')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t firstEquals = line.find('=');
|
size_t firstEquals = line.find('=');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user