From f85dcaee2ab4f1f90761ff369540dc0c3bddad59 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 6 Sep 2016 08:43:15 -0700 Subject: [PATCH] Fixes CID 1369067 and CID 1196684 Fixes CID 1369648 Fixes CID 1372409 --- orte/mca/odls/base/odls_base_default_fns.c | 8 +++++++- orte/mca/oob/tcp/oob_tcp_component.c | 4 ++++ orte/mca/oob/usock/oob_usock_component.c | 1 + orte/mca/rmaps/seq/rmaps_seq.c | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/orte/mca/odls/base/odls_base_default_fns.c b/orte/mca/odls/base/odls_base_default_fns.c index 4430622174..c41d52d278 100644 --- a/orte/mca/odls/base/odls_base_default_fns.c +++ b/orte/mca/odls/base/odls_base_default_fns.c @@ -1047,6 +1047,7 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata) if (ORTE_SUCCESS != (rc = fork_local(app, child, app->env, jobdat))) { child->exit_code = rc; /* error message already output */ ORTE_ACTIVATE_PROC_STATE(&child->name, ORTE_PROC_STATE_FAILED_TO_START); + continue; } orte_wait_cb(child, odls_base_default_wait_local_proc, NULL); /* if we indexed the argv, we need to restore it to @@ -1055,7 +1056,12 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata) if (index_argv) { /* restore the argv[0] */ char *param; - param = strrchr(app->argv[0], '-'); + if (NULL == (param = strrchr(app->argv[0], '-'))) { + child->exit_code = ORTE_ERR_NOT_FOUND; + rc = ORTE_ERR_NOT_FOUND; + ORTE_ACTIVATE_PROC_STATE(&child->name, ORTE_PROC_STATE_FAILED_TO_START); + continue; + } *param = '\0'; } if (ORTE_SUCCESS != rc) { diff --git a/orte/mca/oob/tcp/oob_tcp_component.c b/orte/mca/oob/tcp/oob_tcp_component.c index 5bd00385c9..e8ee6740c0 100644 --- a/orte/mca/oob/tcp/oob_tcp_component.c +++ b/orte/mca/oob/tcp/oob_tcp_component.c @@ -822,6 +822,10 @@ static int component_set_addr(orte_process_name_t *peer, ORTE_NAME_PRINT(peer), uris[i]); /* separate the ports from the network addrs */ ports = strrchr(tcpuri, ':'); + if (NULL == ports) { + ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); + continue; + } *ports = '\0'; ports++; diff --git a/orte/mca/oob/usock/oob_usock_component.c b/orte/mca/oob/usock/oob_usock_component.c index 4d9159a5a6..7ab50d7b21 100644 --- a/orte/mca/oob/usock/oob_usock_component.c +++ b/orte/mca/oob/usock/oob_usock_component.c @@ -222,6 +222,7 @@ static int component_startup(void) "usock", NULL); if ((strlen(session) + 1) > sizeof(mca_oob_usock_component.address.sun_path)-1) { opal_output(0, "SESSION DIR TOO LONG"); + free(session); return ORTE_ERR_NOT_SUPPORTED; } snprintf(mca_oob_usock_component.address.sun_path, diff --git a/orte/mca/rmaps/seq/rmaps_seq.c b/orte/mca/rmaps/seq/rmaps_seq.c index d2da3c5035..c99156f7ca 100644 --- a/orte/mca/rmaps/seq/rmaps_seq.c +++ b/orte/mca/rmaps/seq/rmaps_seq.c @@ -266,6 +266,10 @@ static int orte_rmaps_seq_map(orte_job_t *jdata) seq_list = &sq_list; } else if (orte_get_attribute(&app->attributes, ORTE_APP_HOSTFILE, (void**)&hosts, OPAL_STRING)) { char *hstname; + if (NULL == hosts) { + rc = ORTE_ERR_NOT_FOUND; + goto error; + } opal_output_verbose(5, orte_rmaps_base_framework.framework_output, "mca:rmaps:seq: using hostfile %s nodes on app %s", hosts, app->app); OBJ_CONSTRUCT(&sq_list, opal_list_t);