mirror of
https://github.com/coredns/coredns.git
synced 2026-01-05 00:11:29 -05:00
plugin: fix gosec G115 integer overflow warnings (#7799)
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>
This commit is contained in:
2
plugin/cache/item.go
vendored
2
plugin/cache/item.go
vendored
@@ -82,7 +82,7 @@ func (i *item) toMsg(m *dns.Msg, now time.Time, do bool, ad bool) *dns.Msg {
|
||||
m1.RecursionAvailable = i.RecursionAvailable
|
||||
m1.Rcode = i.Rcode
|
||||
|
||||
ttl := uint32(i.ttl(now))
|
||||
ttl := uint32(i.ttl(now)) // #nosec G115 -- ttl is bounded by DNS TTL limits
|
||||
m1.Answer = filterRRSlice(i.Answer, ttl, true)
|
||||
m1.Ns = filterRRSlice(i.Ns, ttl, true)
|
||||
m1.Extra = filterRRSlice(i.Extra, ttl, true)
|
||||
|
||||
Reference in New Issue
Block a user