Repository navigation
gosec: address G115 integer overflow conversions and re-enable linter - #7362
Open
Ankitraj-sharma wants to merge 1 commit into
Open
Ankitraj-sharma wants to merge 1 commit into
Ankitraj-sharma wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Ankitraj-sharma
force-pushed
the
fix/address-g115-integer-overflow
branch
2 times, most recently
from
October 8, 2026 16:05
d1c94df to
62b5e23
Compare
Address G115 (integer overflow conversion) warnings across the codebase with bounds checks and #nosec annotations for safe conversions, and re-enable the G115 rule in .golangci.yml. Fixes docker#5584 Signed-off-by: Ankit raj sharma <ankitrajsharma666@gmail.com>
Ankitraj-sharma
force-pushed
the
fix/address-g115-integer-overflow
branch
from
October 8, 2026 16:27
62b5e23 to
0163d9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses all G115 (integer overflow conversion) warnings flagged by
gosecacross the codebase with bounds checks and safe#nosec G115annotations, and re-enables the G115 linter in.golangci.ymlas requested in #5584.Detailed Changes:
opts/swarmopts/port.go: Added#nosec G115annotations forTargetPortandPublishedPort(derived fromuint16port numbers).cli/command/service/logs.go: Added#nosec G115annotation wherereplicasis converted tointfor terminal padding calculation.cli/compose/convert/service.go:#nosec G115for healthcheck retries conversion toint.#nosec G115for restart policyuint64Ptr(policy.MaximumRetryCount)(guarded non-negative).cli/command/container/cp.go: Added#nosec G115for terminal column width calculation.cli/command/container/opts.go: Added#nosec G115for non-negativeioMaxBandwidth.cli/command/container/stats_helpers.go: Added explicit guard on elapsed nanoseconds (ns <= 0) before converting touint64(ns).cli/command/image/tree.go: Added#nosec G115for terminal width conversion toint.cli/command/service/progress/progress.go:#nosec G115for replica / running task counts and job concurrency/completion calculations.mappedSlot < 0 || uint64(mappedSlot) > replicasbefore conversion..golangci.yml: Removed- G115fromgosec.excludesto re-enable the linter rule.Release notes (optional)