mirror of https://github.com/docker/cli.git
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 <howardjohn@google.com>
This commit is contained in:
parent
cf8c4bab64
commit
ee97fe95bc
|
@ -120,7 +120,7 @@ func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error {
|
||||||
// LoadFromReader reads the configuration data given and sets up the auth config
|
// LoadFromReader reads the configuration data given and sets up the auth config
|
||||||
// information with given directory and populates the receiver object
|
// information with given directory and populates the receiver object
|
||||||
func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error {
|
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
|
return err
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Reference in New Issue