Skip to content

Commit

Permalink
Fix gosec linting errors with v1.61.0
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis committed Sep 16, 2024
1 parent ac8ad84 commit 08dd88b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/discovery/globalnet/globalnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func GetValidClusterSize(cidrRange string, clusterSize uint) (uint, error) {
}

ones, totalbits := network.Mask.Size()
availableSize := 1 << uint(totalbits-ones)
availableSize := uint(1) << uint(totalbits-ones) //nolint:gosec // Ignore overflow conversion int -> uint
userClusterSize := clusterSize
clusterSize = nextPowerOf2(clusterSize)

if clusterSize > uint(availableSize/2) {
if clusterSize > (availableSize / 2) {
return 0, fmt.Errorf("cluster size %d, should be <= %d", userClusterSize, availableSize/2)
}

Expand Down

0 comments on commit 08dd88b

Please sign in to comment.