Merge pull request #8114 from lioncash/ini-line

IniFile: Prevent potential out-of-bounds access in ParseLine()
This commit is contained in:
Léo Lam 2019-05-23 12:12:41 +02:00 committed by GitHub
commit 67c2aa0701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@
void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut)
{
if (line[0] == '#')
if (line.empty() || line.front() == '#')
return;
size_t firstEquals = line.find('=');