Skip to content

Commit b526bca

Browse files
author
Ralph Castain
committed
Fix a potential segfault by avoiding NULL topologies prior to launching the VM.
Signed-off-by: Ralph Castain <[email protected]>
1 parent b33b460 commit b526bca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

orte/util/nidmap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,13 @@ int orte_util_encode_nodemap(opal_buffer_t *buffer)
641641
OBJ_CONSTRUCT(&bucket, opal_buffer_t);
642642
while (NULL != (item = opal_list_remove_first(&topos))) {
643643
rng = (orte_regex_range_t*)item;
644+
if (NULL == rng->t) {
645+
/* when we pass thru here prior to launching the daemons, we
646+
* won't have topologies for them and so this entry might
647+
* be NULL - protect ourselves */
648+
OBJ_RELEASE(item);
649+
continue;
650+
}
644651
if (NULL == tmp) {
645652
asprintf(&tmp, "%d", rng->cnt);
646653
} else {

0 commit comments

Comments
 (0)