Skip to content

Fix index out of bounds error when building status (#3513) #3576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

sjberman
Copy link
Collaborator

@sjberman sjberman commented Jul 2, 2025

Cherrypick of #3513

Problem: There's a specific scenario where we can hit an out of bounds index while building route statuses. I don't know the exact scenario, but it involves a parentRef without a sectionName, on a Gateway with a single listener. Could possibly involve having multiple implementations being deployed as well.

Solution: Adjust the logic to ensure we don't access indices that are out of bounds.

Testing: Verified that this error does not occur in the previous scenario.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Fix index out of bounds error when building status

Problem: There's a specific scenario where we can hit an out of bounds index while building route statuses. I don't know the exact scenario, but it involves a parentRef without a sectionName, on a Gateway with a single listener. Could possibly involve having multiple implementations being deployed as well.

Solution: Adjust the logic to ensure we don't access indices that are out of bounds.
@sjberman sjberman requested a review from a team as a code owner July 2, 2025 16:31
@github-actions github-actions bot added the bug Something isn't working label Jul 2, 2025
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.19%. Comparing base (fdb1b60) to head (7eb6518).
Report is 1 commits behind head on release-2.0.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-2.0    #3576      +/-   ##
===============================================
+ Coverage        86.81%   95.19%   +8.38%     
===============================================
  Files              127        1     -126     
  Lines            15079      229   -14850     
  Branches            62       62              
===============================================
- Hits             13091      218   -12873     
+ Misses            1837       11    -1826     
+ Partials           151        0     -151     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjberman sjberman merged commit c3d8ba2 into release-2.0 Jul 2, 2025
43 checks passed
@sjberman sjberman deleted the fix/bounds-crash branch July 2, 2025 19:44
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release-notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants