mirror of
https://github.com/coredns/coredns.git
synced 2026-01-02 15:01:34 -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:
@@ -117,7 +117,7 @@ func OPT(bufsize int, do bool) *dns.OPT {
|
||||
o.Hdr.Name = "."
|
||||
o.Hdr.Rrtype = dns.TypeOPT
|
||||
o.SetVersion(0)
|
||||
o.SetUDPSize(uint16(bufsize))
|
||||
o.SetUDPSize(uint16(bufsize)) // #nosec G115 -- buffer size fits in uint16
|
||||
if do {
|
||||
o.SetDo()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user