valyala / fastjson

Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection
MIT License
2.28k stars 137 forks source link

Validate hangs with deeply nested arrays #64

Open WillAbides opened 3 years ago

WillAbides commented 3 years ago

This bit of invalid json causes Validate to hang:

https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_structure_100000_opening_arrays.json

kevburnsjr commented 3 years ago

I saw the same behavior while implementing https://github.com/valyala/fastjson/pull/68.
Recommend enforcing 500 depth (as global var) for both parse and validate.