File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,9 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
310
310
- true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
311
311
- "allowNumericKeys": false or true
312
312
- 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.
313
316
314
317
You can examine 'settings_` yourself
315
318
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)
1865
1865
valid_keys->insert (" strictRoot" );
1866
1866
valid_keys->insert (" allowDroppedNullPlaceholders" );
1867
1867
valid_keys->insert (" allowNumericKeys" );
1868
+ valid_keys->insert (" stackLimit" );
1868
1869
}
1869
1870
bool CharReaderBuilder::validate (Json::Value* invalid) const
1870
1871
{
@@ -1903,6 +1904,7 @@ void CharReaderBuilder::setDefaults(Json::Value* settings)
1903
1904
(*settings)[" strictRoot" ] = false ;
1904
1905
(*settings)[" allowDroppedNullPlaceholders" ] = false ;
1905
1906
(*settings)[" allowNumericKeys" ] = false ;
1907
+ (*settings)[" stackLimit" ] = 1000 ;
1906
1908
// ! [CharReaderBuilderDefaults]
1907
1909
}
1908
1910
You can’t perform that action at this time.
0 commit comments