Skip to content

Check for missing thread count argument for -s/--threads#3940

Open
charliesheh wants to merge 1 commit into
openmc-dev:developfrom
charliesheh:fix-source-strength-range-check
Open

Check for missing thread count argument for -s/--threads#3940
charliesheh wants to merge 1 commit into
openmc-dev:developfrom
charliesheh:fix-source-strength-range-check

Conversation

@charliesheh
Copy link
Copy Markdown

Summary
Adds validation for the -s / --threads command line option to ensure a thread count argument is provided before accessing argv[i].

Previously, invoking:
openmc -s
could result in an out-of-range access and exception rather than returning a clean invalid argument error.

Changes Made

  • Added argument existence check before reading thread count value
  • Returns OPENMC_E_INVALID_ARGUMENT with a descriptive error message when no thread count is specified

Issue
Fixes #3353

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.

-s command line option is not range checked

1 participant