encoding/json: Inconsistent results with pointers and duplicated keys #31776
Labels
Milestone
Comments
CC @mvdan @josharian . |
Change https://golang.org/cl/174699 mentions this issue: |
elwinar
pushed a commit
to elwinar/go
that referenced
this issue
Sep 9, 2019
The indirect method checked the type of the child when indirecting a pointer. If the current value is a pointer and we are decoding null, we can skip this entirely and return early, avoiding the whole descent. Fixes golang#31776 Change-Id: Ib8b2a2357572c41f56fceac59b5a858980f3f65e
elwinar
added a commit
to elwinar/go
that referenced
this issue
Sep 10, 2019
The indirect method checked the type of the child when indirecting a pointer. If the current value is a pointer and we are decoding null, we can skip this entirely and return early, avoiding the whole descent. Fixes golang#31776 Change-Id: Ib8b2a2357572c41f56fceac59b5a858980f3f65e
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/8ELiG37J-JI
What did you expect to see?
What did you see instead?
As mentioned is dvyukov/go-fuzz-corpus#3, although the result itself is valid stricto sensu, it is inconsistent. We would expect either the first or the last indirection to be always nil, while it seems to depends on the previous value of the field.
The text was updated successfully, but these errors were encountered: