Fixes #1122 where json_spirit could stack overflow because there
was no maximum limit set on the number of nested compound elements.
This commit is contained in:
@@ -308,6 +308,12 @@ namespace json_spirit
|
||||
}
|
||||
else
|
||||
{
|
||||
// ZCASH: Prevent potential stack overflow by setting a limit on the number of nested compound elements
|
||||
if (stack_.size() > 128) {
|
||||
throw "too many nested elements";
|
||||
}
|
||||
// ENDZCASH
|
||||
|
||||
stack_.push_back( current_p_ );
|
||||
|
||||
Array_or_obj new_array_or_obj; // avoid copy by building new array or object in place
|
||||
|
||||
Reference in New Issue
Block a user