Skip to content

Commit e4c20e2

Browse files
samuelkgutierrezrhc54
authored andcommitted
Fix memcpy size in pmix_bfrops_base_copy_darray().
Fix incorrect memcpy size for the PMIX_PROC_RANK case found in pmix_bfrops_base_copy_darray(). Signed-off-by: Samuel K. Gutierrez <[email protected]>
1 parent 413c1a8 commit e4c20e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mca/bfrops/base/bfrop_base_copy.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2021-2022 Nanook Consulting All rights reserved.
16+
* Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -607,12 +608,12 @@ pmix_status_t pmix_bfrops_base_copy_darray(pmix_data_array_t **dest, pmix_data_a
607608
memcpy(p->array, src->array, src->size * sizeof(pmix_proc_t));
608609
break;
609610
case PMIX_PROC_RANK:
610-
p->array = (char *) malloc(src->size * sizeof(pmix_rank_t));
611+
p->array = (pmix_rank_t *) malloc(src->size * sizeof(pmix_rank_t));
611612
if (NULL == p->array) {
612613
free(p);
613614
return PMIX_ERR_NOMEM;
614615
}
615-
memcpy(p->array, src->array, src->size * sizeof(pmix_proc_t));
616+
memcpy(p->array, src->array, src->size * sizeof(pmix_rank_t));
616617
break;
617618
case PMIX_APP:
618619
PMIX_APP_CREATE(p->array, src->size);

0 commit comments

Comments
 (0)