Skip to content

Commit 1ed23c5

Browse files
committed
ompi_mpi_init: fix some error handling code paths
Fix CID 1440323: put in a bozo check to ensure that we don't get (argv == NULL && argc > 1). Also add a missing assignment to ret in another error code path. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 02020f3 commit 1ed23c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ompi/runtime/ompi_mpi_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
370370
goto error;
371371
}
372372

373+
/* Bozo argument check */
374+
if (NULL == argv && argc > 1) {
375+
ret = OMPI_ERR_BAD_PARAM;
376+
error = "argc > 1, but argv == NULL";
377+
goto error;
378+
}
379+
373380
/* if we were not externally started, then we need to setup
374381
* some envars so the MPI_INFO_ENV can get the cmd name
375382
* and argv (but only if the user supplied a non-NULL argv!), and
@@ -395,6 +402,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
395402
}
396403
OMPI_TIMING_NEXT("pmix-barrier-1");
397404
if (PMIX_SUCCESS != (rc = PMIx_Fence(NULL, 0, NULL, 0))) {
405+
ret = opal_pmix_convert_status(rc);
398406
error = "timing: pmix-barrier-2 failed";
399407
goto error;
400408
}

0 commit comments

Comments
 (0)