Skip to content
This repository was archived by the owner on Apr 27, 2022. It is now read-only.
This repository was archived by the owner on Apr 27, 2022. It is now read-only.

mapstructure's decoder doesn't zero fields by default #31

Description

@gozer

This has been responsible for traefik/traefik#2153

The longer analysis is available in Traefik's issue, but in short, when loading a stored object from the KV store, it's important to zero the destination fields before loading it up, otherwise, mapstructure will just partially overwrite data, leaving possible extra data present.

In the case of Traaefik, this means a JSON array stored as bytes[] could come back with junk at the end if the new array was shorter than the previous one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions