Skip to content

-s command line option is not range checked #3353

Open
@loganharbour

Description

@loganharbour

Description

Passing the -s/--threads command line option is not range checked. If a value is not provided, we get a logic error thrown instead of a useful error message.

In particular, see

int n_threads = std::stoi(argv[i]);

argv is accessed out of range when executing something like openmc -s.

Alternatives

Add a range check when accessing command line arguments to throw a better error.

Compatibility

Improves user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions