From a5dbbfaf891630fe82c8f709a7d525d0a923143b Mon Sep 17 00:00:00 2001 From: Edgar Solomonik Date: Thu, 28 Apr 2016 19:13:53 +0200 Subject: [PATCH] fixed potential integer overflow bug in assign_keys (used by read_local) --- src/redistribution/sparse_rw.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/redistribution/sparse_rw.cxx b/src/redistribution/sparse_rw.cxx index 1c6f6df9..12e8aaf9 100644 --- a/src/redistribution/sparse_rw.cxx +++ b/src/redistribution/sparse_rw.cxx @@ -188,9 +188,10 @@ namespace CTF_int { char const * vdata, char * vpairs, algstrct const * sr){ - int i, imax, act_lda, idx_offset, act_max, buf_offset; - int64_t p; - int * idx, * virt_rank, * edge_lda; + int i, imax, act_lda, act_max; + int64_t p, idx_offset, buf_offset; + int * idx, * virt_rank; + int64_t * edge_lda; if (order == 0){ ASSERT(size <= 1); if (size == 1){ @@ -202,7 +203,7 @@ namespace CTF_int { TAU_FSTART(assign_keys); CTF_int::alloc_ptr(order*sizeof(int), (void**)&idx); CTF_int::alloc_ptr(order*sizeof(int), (void**)&virt_rank); - CTF_int::alloc_ptr(order*sizeof(int), (void**)&edge_lda); + CTF_int::alloc_ptr(order*sizeof(int64_t), (void**)&edge_lda); memset(virt_rank, 0, sizeof(int)*order);