From d18a5e3adcb3304dba5902a1611c8c56709c1514 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Mon, 28 Aug 2023 17:39:46 +1000 Subject: [PATCH] Fixed new linting issue CWE-118 --- pkg/yqlib/decoder_json.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/yqlib/decoder_json.go b/pkg/yqlib/decoder_json.go index cd8cf5cc..c6b88eca 100644 --- a/pkg/yqlib/decoder_json.go +++ b/pkg/yqlib/decoder_json.go @@ -66,8 +66,8 @@ func (dec *jsonDecoder) convertToYamlNode(data *orderedMap) (*yaml.Node, error) } var yamlMap = &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - for _, keyValuePair := range data.kv { - yamlValue, err := dec.convertToYamlNode(&keyValuePair.V) + for i, keyValuePair := range data.kv { + yamlValue, err := dec.convertToYamlNode(&data.kv[i].V) if err != nil { return nil, err }