You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
Revert "Merge pull request #418 from bbrks/configurable_maxDepth"
This reverts commit44a7e7340d
, reversing changes made todc11f49689
.
This commit is contained in:
5
iter.go
5
iter.go
@ -327,9 +327,12 @@ func (iter *Iterator) Read() interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
// limit maximum depth of nesting, as allowed by https://tools.ietf.org/html/rfc7159#section-9
|
||||
const maxDepth = 10000
|
||||
|
||||
func (iter *Iterator) incrementDepth() (success bool) {
|
||||
iter.depth++
|
||||
if iter.depth <= iter.cfg.maxDepth || iter.cfg.maxDepth < 0 {
|
||||
if iter.depth <= maxDepth {
|
||||
return true
|
||||
}
|
||||
iter.ReportError("incrementDepth", "exceeded max depth")
|
||||
|
Reference in New Issue
Block a user