diff options
author | Songyu Lu <songyulu@hdfgroup.org> | 2019-02-12 19:48:49 (GMT) |
---|---|---|
committer | Songyu Lu <songyulu@hdfgroup.org> | 2019-02-12 19:48:49 (GMT) |
commit | 4e31361dad4add06792b652dbe5b97e501f9031d (patch) | |
tree | a8b1ca9d514a28d6d87e4a78d17994b27960891a /src/H5Olayout.c | |
parent | 9f9485a17a87b075f122b654c1f8426d9114a6df (diff) | |
download | hdf5-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/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index c880435..d0c7f3e 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -243,9 +243,15 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, H5F_addr_decode(f, &p, &(mesg->storage.u.chunk.idx_addr)); /* Chunk dimensions */ - for(u = 0; u < mesg->u.chunk.ndims; u++) + for(u = 0; u < mesg->u.chunk.ndims; u++) { UINT32DECODE(p, mesg->u.chunk.dim[u]); + /* Just in case that something goes very wrong, such as file corruption. */ + if(mesg->u.chunk.dim[u] == 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "chunk dimension must be positive: mesg->u.chunk.dim[%u] = %u", + u, mesg->u.chunk.dim[u]) + } /* end for */ + /* Compute chunk size */ for(u = 1, mesg->u.chunk.size = mesg->u.chunk.dim[0]; u < mesg->u.chunk.ndims; u++) mesg->u.chunk.size *= mesg->u.chunk.dim[u]; |