From 5fa500000ae78458e3ba31e92e54099c51cefb06 Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 22 Feb 2022 13:05:06 -0800 Subject: [PATCH] Fix incorrect pointer inputs to `json.Unmarshal` See https://github.com/howardjohn/go-unmarshal-double-pointer for more info on why this is not safe and how this is detected. Signed-off-by: John Howard (cherry picked from commit ee97fe95bc7f3e1c10f508dc888ec26268d23d79) Signed-off-by: Sebastiaan van Stijn --- cli/config/configfile/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/config/configfile/file.go b/cli/config/configfile/file.go index dc9f39eb7e..d6f710817a 100644 --- a/cli/config/configfile/file.go +++ b/cli/config/configfile/file.go @@ -119,7 +119,7 @@ func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error { // LoadFromReader reads the configuration data given and sets up the auth config // information with given directory and populates the receiver object func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error { - if err := json.NewDecoder(configData).Decode(&configFile); err != nil && !errors.Is(err, io.EOF) { + if err := json.NewDecoder(configData).Decode(configFile); err != nil && !errors.Is(err, io.EOF) { return err } var err error