Skip to content

Fix #2738, use bounded string comparisons - #2791

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-2738-bounded-string-comparisons
Open

Fix #2738, use bounded string comparisons#2791
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-2738-bounded-string-comparisons

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 13, 2026

Copy link
Copy Markdown

Checklist (Please check before submitting)

Describe the contribution

Fix #2738.

Replace the remaining unbounded strcmp() uses under modules/ with bounded comparisons while preserving exact-match behavior.

The change uses bounds derived from the relevant fixed-size field, API-name limit, string literal, or generated configuration-name entry. The configuration name table now records each generated name size so CFE_Config_GetIdByName() can distinguish an exact name from a longer string sharing the same prefix.

Regression coverage includes a prefix-plus-suffix configuration name to verify that bounded comparison does not introduce prefix matching.

Testing performed

  1. Config build and unit tests passed.
  2. ES build and unit tests passed.
  3. TBL build and unit tests passed.
  4. Task Affinity build and unit tests passed.
  5. Fork GitHub Actions passed Format Check, documentation, Static Analysis, both Code Coverage workflows, MCDC Analysis, and both Functional Test workflows.
  6. Fork CodeQL reported startup_failure before any CodeQL job executed.
  7. NASA-side PR workflows currently report action_required with no jobs created. No upstream CI success is being claimed yet.

Expected behavior changes

  • Public API change: none.
  • Internal data change: CFE_Config_IdNameEntry_t records the generated configuration-name size.
  • String comparisons in the affected module paths are bounded while retaining exact-match semantics.
  • No intended functional change for valid null-terminated names.

System(s) tested on

  • Repository baseline: cFE dev.
  • Validation: targeted module builds and unit tests plus the fork GitHub Actions workflows listed above.

Additional context

On the current dev baseline, this patch addresses the remaining unbounded strcmp() uses under modules/ covered by #2738.

Third party code

None.

Contributor Info - All information REQUIRED for consideration of pull request

Sylvester Kaczmarek, Personal

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 16, 2026 09:36
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.

Replace unsafe strcmp() usage with bounded string comparison functions

2 participants