Skip to content

Commit

Permalink
hydra: check error for empty command line
Browse files Browse the repository at this point in the history
Check empty command line and fail early rather than resulting in
mysterious seg faults.
  • Loading branch information
hzhou committed May 13, 2023
1 parent 0f72280 commit 548c671
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pm/hydra/mpiexec/mpiexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ int main(int argc, char **argv)

PMISERV_pg_init();

if (argc == 1) {
HYDU_ERR_SETANDJUMP(status, HYD_INVALID_PARAM, "command line empty. Try -h for usages.\n");
}

/* Get user preferences */
status = HYD_uii_mpx_get_parameters(argv);
HYDU_ERR_POP(status, "error parsing parameters\n");
Expand Down

0 comments on commit 548c671

Please sign in to comment.