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

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

Latest rebase validation

Rebased onto current dev at 39d765fa568943c50c6a8f7dbc957edc31607900. Preserved the upstream startup-parser refactor and moved the relevant change to cfe_es_startupscript.c. Config, ES, TBL, and TA coverage targets all passed for ten repetitions in a Debian 12 arm64 native configuration with EDS disabled. The local TA fixture supplies its required performance ID. Clang-format 19 and git diff --check passed. New upstream CI results are pending.

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 16, 2026 09:36
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-2738-bounded-string-comparisons branch from ab0e583 to 466e40e Compare September 10, 2026 14:50
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Rebased onto current dev and resolved the conflict by moving the change into the new startup-parser source, preserving the upstream refactor. Config, ES, TBL and Task Affinity coverage targets pass for ten repetitions locally; formatting and diff checks pass. New CI results are pending.

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-2738-bounded-string-comparisons branch from 466e40e to 021aef1 Compare October 7, 2026 10:23
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

The bounded-string patch replayed cleanly onto current dev. The previously exercised Config/ES/TBL/Task-Affinity targets remain the focused validation history; the 30-commit base refresh itself introduced no conflict. Please approve the fresh cFE matrix.

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Is this cFE change ready for review, or would you prefer a change in scope?

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

1 participant