Skip to content

plugin: fix gosec G115 integer overflow warnings#7799

Merged
thevilledev merged 1 commit intocoredns:masterfrom
syedazeez337:fix/gosec-g115-integer-overflow
Jan 1, 2026
Merged

plugin: fix gosec G115 integer overflow warnings#7799
thevilledev merged 1 commit intocoredns:masterfrom
syedazeez337:fix/gosec-g115-integer-overflow

Conversation

@syedazeez337
Copy link
Copy Markdown
Contributor

@syedazeez337 syedazeez337 commented Dec 31, 2025

Summary

Fix gosec G115 integer overflow warnings by adding appropriate suppressions where values are provably bounded.

Changes

  • Updated 56 G115 annotations to use consistent // #nosec G115 -- reason format
  • Added 2 //nolint:gosec suppressions for conditional expressions (gosec doesn't always parse inline suppressions in conditionals)
  • Removed G115 exclusion from golangci.yml (now explicitly handled per-line)

Issue

Fixes: #7793

Verification

  • All tests pass with -race flag
  • golangci-lint reports 0 issues
  • Code builds successfully

Fix integer overflow conversion warnings (G115) by adding appropriate
suppressions where values are provably bounded.

Fixes: coredns#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>
@syedazeez337 syedazeez337 force-pushed the fix/gosec-g115-integer-overflow branch from 0773558 to 7eb844f Compare December 31, 2025 18:05
Copy link
Copy Markdown
Collaborator

@thevilledev thevilledev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thevilledev thevilledev merged commit 7b38eb8 into coredns:master Jan 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address remaining gosec linter findings

2 participants