Skip to content

Commit

Permalink
golangci-lint: Fix nolint for G110 (gosec)
Browse files Browse the repository at this point in the history
Looks like with latest version of linter to have annotating code, it
need to be out of conditional statement. This PR fixes
```
pkg/crc/cluster/pullsecret.go:124:15: G110: Potential DoS vulnerability via decompression bomb (gosec)
	if _, err := io.Copy(&b, decompressor); err != nil {
	             ^
make: *** [Makefile:284: cross-lint] Error 1
```
  • Loading branch information
praveenkumar authored and anjannath committed Jun 6, 2024
1 parent d20410a commit b880342
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/crc/cluster/pullsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ func loadFromKeyring() (string, error) {
}
var b bytes.Buffer
// #nosec G110
if _, err := io.Copy(&b, decompressor); err != nil {
_, err = io.Copy(&b, decompressor)
if err != nil {
return "", err
}
if err := decompressor.Close(); err != nil {
Expand Down

0 comments on commit b880342

Please sign in to comment.