Skip to content

Commit 7e9e16c

Browse files
committed
make sure the iov buffer is initialized to zero, otherwise bad things can happen for 0-byte contributions on a process.
1 parent 2c7265d commit 7e9e16c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/io/ompio/io_ompio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ int ompi_io_ompio_generate_current_file_view (struct mca_io_ompio_file_t *fh,
190190
int block = 1;
191191

192192
/* allocate an initial iovec, will grow if needed */
193-
iov = (struct iovec *) malloc
194-
(OMPIO_IOVEC_INITIAL_SIZE * sizeof (struct iovec));
193+
iov = (struct iovec *) calloc
194+
(OMPIO_IOVEC_INITIAL_SIZE, sizeof (struct iovec));
195195
if (NULL == iov) {
196196
opal_output(1, "OUT OF MEMORY\n");
197197
return OMPI_ERR_OUT_OF_RESOURCE;

0 commit comments

Comments
 (0)