mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-09-21 03:41:42 +02: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue