diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-05-22 21:09:09 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-05-22 21:09:11 -0400 |
| commit | 2ae370fc371e14a3f4d7765cf361a0a911452471 (patch) | |
| tree | ccaddec3ef20c4d870a937a4e72abbee665f6cf1 /Source/Core/Common/IniFile.cpp | |
| parent | e2c769a9c5afa9171f45d36ee39a0c176f24ee13 (diff) | |
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.
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
| -rw-r--r-- | Source/Core/Common/IniFile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index 43bbe7b50b..c0e07df483 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -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('='); |
