Skip to content

Commit

Permalink
utils: fix gosec warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Oliveira <charles.oliveira@linaro.org>
  • Loading branch information
chaws committed Jun 25, 2021
1 parent 17651f9 commit a8f7434
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var CacheDir string

func ReadURL(url string) ([]byte, error) {
var empty []byte
resp, err := http.Get(url)
resp, err := http.Get(url) // #nosec
if err != nil {
return empty, err
}
Expand All @@ -50,7 +50,7 @@ func ReadURL(url string) ([]byte, error) {

if len(CacheDir) > 0 {
fileName := path.Join(CacheDir, path.Base(url))
err = ioutil.WriteFile(fileName, body, 0666)
err = ioutil.WriteFile(fileName, body, 0600)
if err != nil {
return body, err
}
Expand Down Expand Up @@ -99,7 +99,7 @@ func WriteXML(path string, targetStruct interface{}) error {
return nil
}

err = ioutil.WriteFile(path, output, 0666)
err = ioutil.WriteFile(path, output, 0600)
if err != nil {
return err
}
Expand Down

0 comments on commit a8f7434

Please sign in to comment.