Skip to content

Fix critical safety and correctness issues in release.sh#2341

Open
rauldsl wants to merge 1 commit intoOpenSCAP:mainfrom
rauldsl:release.sh
Open

Fix critical safety and correctness issues in release.sh#2341
rauldsl wants to merge 1 commit intoOpenSCAP:mainfrom
rauldsl:release.sh

Conversation

@rauldsl
Copy link
Copy Markdown
Contributor

@rauldsl rauldsl commented Apr 19, 2026

Description of Problem:

This PR fixes a few critical issues in release.sh that could lead to incorrect behavior or unsafe execution paths during release operations.

Main issues addressed:

  • Unsafe dynamic function call via increment_on_$1
  • Incorrect argument validation in bump_release()
  • Potential word-splitting issues in apply_triplets_to_file()

OpenSCAP Version:

main


Operating System & Version:

macOS / Linux (shell script portability affected)


Steps to Reproduce:

  1. Run release.sh with invalid strategy argument
  2. Attempt LT version bump process
  3. Observe incorrect or unsafe execution paths

Actual Results:

  • Script may attempt to execute undefined functions dynamically
  • Incorrect argument validation behavior
  • Risk of silent parsing issues in array handling

Expected Results:

  • Strict validation of LT versioning strategy
  • Safe and explicit control flow for version increments
  • Robust array handling without word-splitting issues

Additional Information / Debugging Steps:

Validated with:

  • bash -n
  • manual inspection of release flow logic

No functional changes intended for valid execution paths.

- Replace unsafe dynamic function dispatch (increment_on_$1) with explicit case validation
- Fix incorrect argument validation in bump_release()
- Harden apply_triplets_to_file() to avoid word-splitting issues
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant