summaryrefslogtreecommitdiffstats
path: root/src/H5Dselect.c
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-24 19:36:32 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-24 19:36:32 (GMT)
commit6e9b7ced76c921a0d82d1712d58bc5505f8fd811 (patch)
tree195f89b5d727f9632af8b60bddee5736c19ebb0c /src/H5Dselect.c
parentcac673138c94cdbd5faa227fe5a9867941753c93 (diff)
downloadhdf5-6e9b7ced76c921a0d82d1712d58bc5505f8fd811.zip
hdf5-6e9b7ced76c921a0d82d1712d58bc5505f8fd811.tar.gz
hdf5-6e9b7ced76c921a0d82d1712d58bc5505f8fd811.tar.bz2
Fixed HDFFV-10210 and HDFFV-10587
Description: - Added parameter validation (HDFFV-10210) - Added detection of division by zero (HDFFV-10587 - CVE-2018-17438) - Fixed typos in various tests Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1011test)
Diffstat (limited to 'src/H5Dselect.c')
-rw-r--r--src/H5Dselect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Dselect.c b/src/H5Dselect.c
index 7e86b9d..7c02c05 100644
--- a/src/H5Dselect.c
+++ b/src/H5Dselect.c
@@ -220,6 +220,8 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size,
/* Decrement number of elements left to process */
HDassert(((size_t)tmp_file_len % elmt_size) == 0);
+ if(elmt_size == 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "Resulted in division by zero")
nelmts -= ((size_t)tmp_file_len / elmt_size);
} /* end while */
} /* end else */