summaryrefslogtreecommitdiffstats
path: root/src/H5HG.c
diff options
context:
space:
mode:
authorSongyu Lu <songyulu@hdfgroup.org>2019-02-12 19:48:49 (GMT)
committerSongyu Lu <songyulu@hdfgroup.org>2019-02-12 19:48:49 (GMT)
commit4e31361dad4add06792b652dbe5b97e501f9031d (patch)
treea8b1ca9d514a28d6d87e4a78d17994b27960891a /src/H5HG.c
parent9f9485a17a87b075f122b654c1f8426d9114a6df (diff)
downloadhdf5-4e31361dad4add06792b652dbe5b97e501f9031d.zip
hdf5-4e31361dad4add06792b652dbe5b97e501f9031d.tar.gz
hdf5-4e31361dad4add06792b652dbe5b97e501f9031d.tar.bz2
I'm bringing the fixes for the following Jira issues from the develop branch to 1.10 branch:
HDFFV-10571: Divided by Zero vulnerability. HDFFV-10601: Issues with chunk cache hash value calcuation. HDFFV-10607: Patches for warnings in the core libraries. HDFFV-10635: HDF5 library segmentation fault with H5Sselect_element.
Diffstat (limited to 'src/H5HG.c')
-rw-r--r--src/H5HG.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index 53f1b2a..29cd90f 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -785,7 +785,13 @@ H5HG_remove (H5F_t *f, H5HG_t *hobj)
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap")
HDassert(hobj->idx < heap->nused);
- HDassert(heap->obj[hobj->idx].begin);
+ /* When the application selects the same location to rewrite the VL element by using H5Sselect_elements,
+ * it can happen that the entry has been removed by first rewrite. Here we simply skip the removal of
+ * the entry and let the second rewrite happen (see HDFFV-10635). In the future, it'd be nice to handle
+ * this situation in H5T_conv_vlen in H5Tconv.c instead of this level (HDFFV-10648). */
+ if(heap->obj[hobj->idx].nrefs == 0 && heap->obj[hobj->idx].size == 0 && !heap->obj[hobj->idx].begin)
+ HGOTO_DONE(ret_value)
+
obj_start = heap->obj[hobj->idx].begin;
/* Include object header size */
need = H5HG_ALIGN(heap->obj[hobj->idx].size) + H5HG_SIZEOF_OBJHDR(f);