Skip to content

Fix static analysis blocker: bounds-guard m_directories in DpCatalog#4964

Open
sympact06 wants to merge 2 commits intonasa:develfrom
sympact06:fix/dp-catalog-static-analysis-4521
Open

Fix static analysis blocker: bounds-guard m_directories in DpCatalog#4964
sympact06 wants to merge 2 commits intonasa:develfrom
sympact06:fix/dp-catalog-static-analysis-4521

Conversation

@sympact06
Copy link
Copy Markdown

Related Issue(s) #4521
Has Unit Tests (y/n) n)
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

Clamp the loop bound in fillBinaryTree() to DP_MAX_DIRECTORIES so that
m_directories[dir] is provably in-bounds for the static analyzer.

Rationale

Resolves the SonarQube Blocker finding:

Line 399: Access of the field 'm_directories' at index 2, while it holds only 2 'class Fw::FileNameString' elements

Testing/Review Recommendations

No behavioral change the clamp is purely defensive

Future Work

Remaining non-blocker static analysis findings from #4521

AI Usage (see policy)

Claude Code (Anthropic, Opus 4.6) was used to:

  • Analyze the static analysis finding and identify the root cause

First PR to fprime! Hope to contribute more and learn along the way

@sympact06 sympact06 marked this pull request as ready for review April 7, 2026 12:09
@timcanham
Copy link
Copy Markdown
Collaborator

Let's merge #4897 first.

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.

2 participants