Skip to content

Commit

Permalink
lint: replace math/rand.Read with crypto/rand.Read
Browse files Browse the repository at this point in the history
  • Loading branch information
pires committed Oct 8, 2024
1 parent 2df67b4 commit 05c6f18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package proxyproto
import (
"bufio"
"bytes"
iorand "crypto/rand"
"encoding/binary"
"math/rand"
"reflect"
Expand Down Expand Up @@ -51,7 +52,7 @@ var (
fixtureUnixV2 = append(lengthUnixBytes, fixtureUnixAddress...)
fixtureTLV = func() []byte {
tlv := make([]byte, 2+rand.Intn(1<<12)) // Not enough to overflow, at least size two
rand.Read(tlv)
_, _ = iorand.Read(tlv)
return tlv
}()
fixtureIPv4V2TLV = fixtureWithTLV(lengthV4Bytes, fixtureIPv4Address, fixtureTLV)
Expand Down

0 comments on commit 05c6f18

Please sign in to comment.