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 15, 2023
1 parent bba85c7 commit 73dddde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pm/hydra/mpiexec/mpiexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ int main(int argc, char **argv)

PMISERV_pg_init();

if (argc == 1) {
HYDU_ERR_SETANDJUMP(status, HYD_INVALID_PARAM,
"No executable provided. 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 73dddde

Please sign in to comment.