From 36b9e15fb7e8f7f606d0114aac331e795faacb4e Mon Sep 17 00:00:00 2001 From: "John L. Jolly" Date: Tue, 22 May 2018 10:04:40 -0600 Subject: [PATCH] - Build warning: stringop-overflow in get_dynamic_win_info() at osc_ucx_comm.c In file included from /usr/include/string.h:494:0, from ../../../../ompi/info/info.h:29, from ../../../../ompi/mca/osc/base/base.h:24, from osc_ucx_comm.c:13: In function 'memcpy', inlined from 'get_dynamic_win_info' at osc_ucx_comm.c:359:5, inlined from 'ompi_osc_ucx_put' at osc_ucx_comm.c:401:18: /usr/include/bits/string_fortified.h:34:10: warning: '__builtin___memcpy_chk' writing 8 bytes into a region of size 4 overflows the destination [-Wstringop-overflow=] return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is caused by a type size mismatch in a call to memcpy This fix corrects the type definition of the win_count variable. Signed-off-by: John Jolly --- ompi/mca/osc/ucx/osc_ucx_comm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ompi/mca/osc/ucx/osc_ucx_comm.c b/ompi/mca/osc/ucx/osc_ucx_comm.c index 22f4ce1e94..e9e2b40f82 100644 --- a/ompi/mca/osc/ucx/osc_ucx_comm.c +++ b/ompi/mca/osc/ucx/osc_ucx_comm.c @@ -332,7 +332,8 @@ static inline int get_dynamic_win_info(uint64_t remote_addr, ompi_osc_ucx_module size_t len = sizeof(uint64_t) + sizeof(ompi_osc_dynamic_win_info_t) * OMPI_OSC_UCX_ATTACH_MAX; char *temp_buf = malloc(len); ompi_osc_dynamic_win_info_t *temp_dynamic_wins; - int win_count, contain, insert = -1; + uint64_t win_count; + int contain, insert = -1; ucs_status_t status; if ((module->win_info_array[target]).rkey_init == true) {