Skip to content

Commit 8b46118

Browse files
author
rhc54
authored
Merge pull request #2057 from rhc54/topic/cid
Coverity fixes
2 parents a17dff2 + f85dcae commit 8b46118

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

orte/mca/odls/base/odls_base_default_fns.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,7 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
10471047
if (ORTE_SUCCESS != (rc = fork_local(app, child, app->env, jobdat))) {
10481048
child->exit_code = rc; /* error message already output */
10491049
ORTE_ACTIVATE_PROC_STATE(&child->name, ORTE_PROC_STATE_FAILED_TO_START);
1050+
continue;
10501051
}
10511052
orte_wait_cb(child, odls_base_default_wait_local_proc, NULL);
10521053
/* 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)
10551056
if (index_argv) {
10561057
/* restore the argv[0] */
10571058
char *param;
1058-
param = strrchr(app->argv[0], '-');
1059+
if (NULL == (param = strrchr(app->argv[0], '-'))) {
1060+
child->exit_code = ORTE_ERR_NOT_FOUND;
1061+
rc = ORTE_ERR_NOT_FOUND;
1062+
ORTE_ACTIVATE_PROC_STATE(&child->name, ORTE_PROC_STATE_FAILED_TO_START);
1063+
continue;
1064+
}
10591065
*param = '\0';
10601066
}
10611067
if (ORTE_SUCCESS != rc) {

orte/mca/oob/tcp/oob_tcp_component.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,10 @@ static int component_set_addr(orte_process_name_t *peer,
822822
ORTE_NAME_PRINT(peer), uris[i]);
823823
/* separate the ports from the network addrs */
824824
ports = strrchr(tcpuri, ':');
825+
if (NULL == ports) {
826+
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
827+
continue;
828+
}
825829
*ports = '\0';
826830
ports++;
827831

orte/mca/oob/usock/oob_usock_component.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ static int component_startup(void)
222222
"usock", NULL);
223223
if ((strlen(session) + 1) > sizeof(mca_oob_usock_component.address.sun_path)-1) {
224224
opal_output(0, "SESSION DIR TOO LONG");
225+
free(session);
225226
return ORTE_ERR_NOT_SUPPORTED;
226227
}
227228
snprintf(mca_oob_usock_component.address.sun_path,

orte/mca/rmaps/seq/rmaps_seq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
266266
seq_list = &sq_list;
267267
} else if (orte_get_attribute(&app->attributes, ORTE_APP_HOSTFILE, (void**)&hosts, OPAL_STRING)) {
268268
char *hstname;
269+
if (NULL == hosts) {
270+
rc = ORTE_ERR_NOT_FOUND;
271+
goto error;
272+
}
269273
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
270274
"mca:rmaps:seq: using hostfile %s nodes on app %s", hosts, app->app);
271275
OBJ_CONSTRUCT(&sq_list, opal_list_t);

0 commit comments

Comments
 (0)