linting: suppress false positive for G404 (gosec)
The linter falsely detects this as using "math/rand": libnetwork/networkdb/cluster.go:721:14: G404: Use of weak random number generator (math/rand instead of crypto/rand) (gosec) val, err := rand.Int(rand.Reader, big.NewInt(int64(n))) ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a33d1f9a7c
commit
561a010161
1 changed files with 1 additions and 1 deletions
|
@ -718,7 +718,7 @@ func randomOffset(n int) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
val, err := rand.Int(rand.Reader, big.NewInt(int64(n)))
|
||||
val, err := rand.Int(rand.Reader, big.NewInt(int64(n))) // #nosec G404 -- False positive; see https://github.com/securego/gosec/issues/862
|
||||
if err != nil {
|
||||
logrus.Errorf("Failed to get a random offset: %v", err)
|
||||
return 0
|
||||
|
|
Loading…
Reference in a new issue