File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,6 +310,9 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
310310 - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
311311 - "allowNumericKeys": false or true
312312 - true if numeric object keys are allowed.
313+ - "stackLimit": integer
314+ - This is a security issue (seg-faults caused by deeply nested JSON),
315+ so the default is low.
313316
314317 You can examine 'settings_` yourself
315318 to see the defaults. You can also write and read them just like any
Original file line number Diff line number Diff line change @@ -1865,6 +1865,7 @@ static void getValidReaderKeys(std::set<std::string>* valid_keys)
18651865 valid_keys->insert (" strictRoot" );
18661866 valid_keys->insert (" allowDroppedNullPlaceholders" );
18671867 valid_keys->insert (" allowNumericKeys" );
1868+ valid_keys->insert (" stackLimit" );
18681869}
18691870bool CharReaderBuilder::validate (Json::Value* invalid) const
18701871{
@@ -1903,6 +1904,7 @@ void CharReaderBuilder::setDefaults(Json::Value* settings)
19031904 (*settings)[" strictRoot" ] = false ;
19041905 (*settings)[" allowDroppedNullPlaceholders" ] = false ;
19051906 (*settings)[" allowNumericKeys" ] = false ;
1907+ (*settings)[" stackLimit" ] = 1000 ;
19061908// ! [CharReaderBuilderDefaults]
19071909}
19081910
You can’t perform that action at this time.
0 commit comments