summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-10-28 04:20:29 (GMT)
committerGitHub <noreply@github.com>2023-10-28 04:20:29 (GMT)
commitedb5cffdb20ad959c80b665cb8c2589f4c71414d (patch)
tree12731836af8100c34415f3e4aea744f814f2f242
parent1bcef50b864fb1ea6e00900b3982e71d183cfda5 (diff)
downloadhdf5-edb5cffdb20ad959c80b665cb8c2589f4c71414d.zip
hdf5-edb5cffdb20ad959c80b665cb8c2589f4c71414d.tar.gz
hdf5-edb5cffdb20ad959c80b665cb8c2589f4c71414d.tar.bz2
Avoid attempted use of NULL pointer in parallel compression code (#3786)
The parallel compression test code tests for the case where all MPI ranks have no selection in a dataset when writing to it. Add an early exit to the code to avoid attempting to use a NULL pointer due to there being no work to do.
-rw-r--r--src/H5Dmpio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 16243fa..b40ab4b 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -3782,6 +3782,10 @@ H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chun
counts_disps_array = H5MM_xfree(counts_disps_array);
}
+ /* No useful work to do - exit */
+ if (coll_chunk_list_num_entries == 0)
+ HGOTO_DONE(SUCCEED);
+
/*
* Phase 2 - Involved ranks now redistribute any shared chunks to new
* owners as necessary.