stackLimit

This commit is contained in:
Christopher Dunn 2015-02-10 12:16:03 -06:00
parent 99b8e856f6
commit 249ad9f47f
2 changed files with 5 additions and 0 deletions

View File

@ -310,6 +310,9 @@ public:
- true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
- "allowNumericKeys": false or true
- true if numeric object keys are allowed.
- "stackLimit": integer
- This is a security issue (seg-faults caused by deeply nested JSON),
so the default is low.
You can examine 'settings_` yourself
to see the defaults. You can also write and read them just like any

View File

@ -1865,6 +1865,7 @@ static void getValidReaderKeys(std::set<std::string>* valid_keys)
valid_keys->insert("strictRoot");
valid_keys->insert("allowDroppedNullPlaceholders");
valid_keys->insert("allowNumericKeys");
valid_keys->insert("stackLimit");
}
bool CharReaderBuilder::validate(Json::Value* invalid) const
{
@ -1903,6 +1904,7 @@ void CharReaderBuilder::setDefaults(Json::Value* settings)
(*settings)["strictRoot"] = false;
(*settings)["allowDroppedNullPlaceholders"] = false;
(*settings)["allowNumericKeys"] = false;
(*settings)["stackLimit"] = 1000;
//! [CharReaderBuilderDefaults]
}