diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2017-08-22 06:36:20 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2017-08-22 06:36:20 (GMT) |
commit | b07eb6efd06bbe44562fe6c93e826f40a56c01d2 (patch) | |
tree | e757d29d387275cd8fb8351f5148634277bb176d /src/H5HL.c | |
parent | a6d5bf1a86250cc660cd1ed420eeda6940792be5 (diff) | |
download | hdf5-b07eb6efd06bbe44562fe6c93e826f40a56c01d2.zip hdf5-b07eb6efd06bbe44562fe6c93e826f40a56c01d2.tar.gz hdf5-b07eb6efd06bbe44562fe6c93e826f40a56c01d2.tar.bz2 |
Fix for HDFFV-10216 segfault in H5G_node_cmp3 with corrupt h5 file
Fix H5HL_offset_into() to return error when offset exceeds heap data block size.
Also fix other places that call this routine to detect error return.
Diffstat (limited to 'src/H5HL.c')
-rw-r--r-- | src/H5HL.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -400,18 +400,20 @@ END_FUNC(PRIV) /* end H5HL_protect() */ * *------------------------------------------------------------------------- */ -BEGIN_FUNC(PRIV, NOERR, -void *, NULL, -, +BEGIN_FUNC(PRIV, ERR, +void *, NULL, NULL, H5HL_offset_into(const H5HL_t *heap, size_t offset)) /* Sanity check */ HDassert(heap); - HDassert(offset < heap->dblk_size); + if(offset >= heap->dblk_size) + H5E_THROW(H5E_CANTGET, "unable to offset into local heap data block"); ret_value = heap->dblk_image + offset; +CATCH + /* No special processing on errors */ END_FUNC(PRIV) /* end H5HL_offset_into() */ - /*------------------------------------------------------------------------- * Function: H5HL_unprotect |