Open
Description
I'm dealing with a large, flat json payload that has 100+ keys in a map.
I hit panics when using EachKey with the full list of json keys:
goroutine 1 [running]:
panic(0x4e8ac0, 0xc42000a0f0)
/home/niek/go17/src/runtime/panic.go:500 +0x1a1
github.com/buger/jsonparser.EachKey(0xc421480000, 0x11ac, 0x11ac, 0xc420050e30, 0xc4200da000, 0xaf, 0x100, 0x0)
/home/niek/workspace/src/github.com/buger/jsonparser/parser.go:237 +0x6a6
...snipped...
The problem code seems here:
https://github.com/buger/jsonparser/blob/master/parser.go#L236
If I'm reading it right, there is a limit of 64 keys per EachKey lookup before the int64 bitmask overflows.
Limit should probably be documented and code should return an error rather than panic.
Metadata
Metadata
Assignees
Labels
No labels