Fix G602 analyzer panic that kills gosec process#1491
Merged
ccojocar merged 4 commits intosecurego:masterfrom Feb 7, 2026
Merged
Fix G602 analyzer panic that kills gosec process#1491ccojocar merged 4 commits intosecurego:masterfrom
ccojocar merged 4 commits intosecurego:masterfrom
Conversation
Contributor
Author
|
This PR should follow after the merge of #1492 |
d1d12f8 to
69cbfcc
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1491 +/- ##
==========================================
+ Coverage 68.49% 69.47% +0.97%
==========================================
Files 75 85 +10
Lines 4384 6748 +2364
==========================================
+ Hits 3003 4688 +1685
- Misses 1233 1828 +595
- Partials 148 232 +84 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ccojocar
approved these changes
Feb 7, 2026
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.
Fixes #1489 - Running gosec with G602 enabled crashes on certain codebases.
The issue is that the G602 slice-bounds analyzer panics on certain SSA instruction patterns (nil const values, short type strings, nil blocks). Since there is no
recover()in the analyzer's run path, the panic propagates and terminates the entire gosec process before any results are written.Fix:
defer recover()to the analyzer run function - G602 panic degrades to a logged error instead of crashing the process