From ee9d595a8cd92de04d79436ffcb8e75195ac5964 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 3 Jul 2014 10:43:48 -0500 Subject: [svn-r25392] fix HDFFV-8761: allocating space for zero-length chunked dataset and asserting. --- src/H5Dchunk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index f92260c..20b3c1a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -743,8 +743,10 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf fm->select_chunk = NULL; if(io_info->using_mpi_vfd) { H5_CHECK_OVERFLOW(fm->layout->u.chunk.nchunks, hsize_t, size_t); - if(NULL == (fm->select_chunk = (H5D_chunk_info_t **)H5MM_calloc((size_t)fm->layout->u.chunk.nchunks * sizeof(H5D_chunk_info_t *)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") + if(fm->layout->u.chunk.nchunks) { + if(NULL == (fm->select_chunk = (H5D_chunk_info_t **)H5MM_calloc((size_t)fm->layout->u.chunk.nchunks * sizeof(H5D_chunk_info_t *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") + } } /* end if */ #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12