Skip to content

Improve slice bound check#1442

Merged
ccojocar merged 1 commit intosecurego:masterfrom
ccojocar:g602_switch_check
Dec 28, 2025
Merged

Improve slice bound check#1442
ccojocar merged 1 commit intosecurego:masterfrom
ccojocar:g602_switch_check

Conversation

@ccojocar
Copy link
Copy Markdown
Member

@ccojocar ccojocar commented Dec 28, 2025

Improve slice bound check to habdle bounded values and properly parse the address index only from references

fixes #1250
fixes #1406

Improve slice bound check to habdle bounded values and properly parse
the address index only from references

Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 28, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 82.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.57%. Comparing base (1216c9b) to head (189292e).
⚠️ Report is 148 commits behind head on master.

Files with missing lines Patch % Lines
analyzers/slice_bounds.go 82.50% 6 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1442      +/-   ##
==========================================
- Coverage   68.49%   64.57%   -3.93%     
==========================================
  Files          75       78       +3     
  Lines        4384     4739     +355     
==========================================
+ Hits         3003     3060      +57     
- Misses       1233     1531     +298     
  Partials      148      148              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ccojocar ccojocar merged commit c073629 into securego:master Dec 28, 2025
6 checks passed
@ccojocar ccojocar deleted the g602_switch_check branch December 28, 2025 17:43
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.

G602 (CWE-118): slice index out of range false positive False Positive for G602 with bounds check using switch

2 participants