mirror of
https://github.com/coredns/coredns.git
synced 2026-01-02 06:51:26 -05:00
Fix integer overflow conversion warnings (G115) by adding appropriate suppressions where values are provably bounded. Fixes: https://github.com/coredns/coredns/issues/7793 Changes: - Updated 56 G115 annotations to use consistent // #nosec G115 format - Added 2 //nolint:gosec suppressions for conditional expressions - Removed G115 exclusion from golangci.yml (now explicitly handled per-line) Suppressions justify why each conversion is safe (e.g., port numbers are bounded 1-65535, DNS TTL limits, pool lengths, etc.) Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
18 lines
380 B
Go
18 lines
380 B
Go
package etcd
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/coredns/coredns/request"
|
|
)
|
|
|
|
// Serial returns the serial number to use.
|
|
func (e *Etcd) Serial(state request.Request) uint32 {
|
|
return uint32(time.Now().Unix()) // #nosec G115 -- Unix time to SOA serial, Year 2106 problem accepted
|
|
}
|
|
|
|
// MinTTL returns the minimal TTL.
|
|
func (e *Etcd) MinTTL(state request.Request) uint32 {
|
|
return 30
|
|
}
|