Merge pull request #21 from dbehnke/fix/configure-json-safety

Fix: hardening CConfigure::GetBoolean against missing keys
main
nostar 1 month ago committed by GitHub
commit bd0c114e43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -982,8 +982,8 @@ unsigned CConfigure::GetUnsigned(const std::string &key) const
bool CConfigure::GetBoolean(const std::string &key) const
{
if (data[key].is_boolean())
return data[key];
if (data.contains(key) && data[key].is_boolean())
return data[key].get<bool>();
else
return false;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.