Skip to content

panic: runtime error: index out of range #143

Closed

Description

@bshafiee

Our production machines hit this error after running for a long time (couple of months). Unfortunately we do not have the payload to recreate but I've the stacktrace (I'll add more information if I find out more):

  	 log:	 	/go/src/.../vendor/github.com/buger/jsonparser/parser.go:816 +0x73
github.com/.../vendor/github.com/buger/jsonparser.Get(0xc43e44e000, 0x6dc, 0x6dc, 0xc43d77e5e0, 0x1, 0x1, 0xc43d77e5d0, 0x1, 0x1, 0xc43e44e000, ...)

  	 log:	 	/go/src/.../vendor/github.com/buger/jsonparser/parser.go:822 +0x26a
github.com/.../vendor/github.com/buger/jsonparser.internalGet(0xc43e44e000, 0x6dc, 0x6dc, 0xc43d77e5e0, 0x1, 0x1, 0xc43cd9b1a0, 0xb, 0x6dc, 0x6dc, ...)

...
  	 log:	 	/go/src/.../vendor/github.com/buger/jsonparser/parser.go:259 +0x930
  	 github.com/.../vendor/github.com/buger/jsonparser.searchKeys(0xc43e44e000, 0x6dc, 0x6dc, 0xc43d77e5e0, 0x1, 0x1, 0x6bf)


  	 log:	 panic: runtime error: index out of range

It seems like the following line in the searchKeys function causes the panic:
if equalStr(&keyUnesc, keys[level-1]) {

since we point to the master branch in our dep manager I am not sure which exact version it was using either :(

Activity

  1. buger commented on Jul 28, 2026

    @buger
    Owner

    Closing as stale — this 2018 report has no payload and predates multiple rounds of bounds/panic fixes (v1.0.0, v1.3.0, v1.3.1). The parser now has 118 formal requirements with 100% MC/DC coverage and structure-aware fuzzing (250k inputs/sec). If you hit a panic on current master, please open a new issue with the exact input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions