Do a bounds check before calling functions defined in cctype

This commit is contained in:
Evil Eye 2021-11-10 21:25:16 +01:00
parent c01ba41aa6
commit 751e8cf76b
9 changed files with 44 additions and 37 deletions

View file

@ -311,7 +311,7 @@ void Settings::SettingsFileParser::saveSettingsFile(const std::string& file, con
bool Settings::SettingsFileParser::skipWhiteSpace(size_t& i, std::string& str)
{
while (i < str.size() && std::isspace(str[i], std::locale::classic()))
while (i < str.size() && str[i] >= 0 && str[i] <= 255 && std::isspace(str[i], std::locale::classic()))
{
++i;
}