fix: add security comment for Unix timestamp handling in CreatePacket function

This commit is contained in:
2025-11-20 18:04:22 -06:00
parent 2a2d6d6515
commit 4859f5513a

View File

@@ -355,6 +355,7 @@ func (a *Announce) CreatePacket() []byte {
}
// Add 5 bytes of timestamp
timeBytes := make([]byte, 8)
// #nosec G115 - Unix timestamp is always positive, no overflow risk
binary.BigEndian.PutUint64(timeBytes, uint64(time.Now().Unix()))
copy(randomHash[5:], timeBytes[:5])