Closed
Description
One of the fuzz tests in Kubernetes caught an issue:
This library:
{"metadata":{"selfLink":"Ǭ`/F苫ŽȢ噯榋C","resourceVersion":"4597642297830476577"},"items":[{"metadata":{"name":"玿j情1 蔝","generateName":"萀枦đ ","uid":".愥+ǽķ蓧u岏V","resourceVersion":"13323996552230461162","creationTimestamp":null},"data":{"輣 兀zʩL:Ģ梸ïĭ":"MŞFƤ趻Ă癆萃猷S幸4"},"binaryData":{"Ȟ櫤薯WDZĥȂ":null}}]}
encoding/json
:
{"metadata":{"selfLink":"Ǭ`/F苫ŽȢ噯榋C","resourceVersion":"4597642297830476577"},"items":[{"metadata":{"name":"玿j情1 蔝","generateName":"萀枦đ ","uid":".愥+ǽķ蓧u岏V","resourceVersion":"13323996552230461162","creationTimestamp":null},"data":{"輣 兀zʩL:Ģ梸ïĭ":"MŞFƤ趻Ă癆萃猷S幸4"},"binaryData":{"Ȟ櫤薯WDZĥȂ":""}}]}
Notice how at the very end of the json the value in the map is not the same.
BinaryData field is declared like this:
BinaryData map[string][]byte `json:"binaryData,omitempty"`
Trying to migrate all encoding/json
uses to this library in this PR kubernetes/kubernetes#63284
This is using commit 2ddf6d7
Metadata
Metadata
Assignees
Labels
No labels