summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-24 02:10:30 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-24 02:10:30 (GMT)
commitd818edb110b668489d5c33ebc5c94dd9ef767121 (patch)
tree8c090b000e6676aa6cc36722140857b6dfe339f0 /src
parent02abb65dde9beccb289bc5ef1df3ea0ceaa41379 (diff)
parentfe104cc38ffbdb39d3e04da107d86ebfc7e8b622 (diff)
downloadhdf5-d818edb110b668489d5c33ebc5c94dd9ef767121.zip
hdf5-d818edb110b668489d5c33ebc5c94dd9ef767121.tar.gz
hdf5-d818edb110b668489d5c33ebc5c94dd9ef767121.tar.bz2
Merge pull request #1610 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_fixbug:develop to develop
* commit 'fe104cc38ffbdb39d3e04da107d86ebfc7e8b622': Test improvement Description Moved the new tests to a more appropriate test function. Platforms tested: Linux/64 (jelly) 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')
-rw-r--r--src/H5Dselect.c2
-rw-r--r--src/H5I.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/H5Dselect.c b/src/H5Dselect.c
index 0ec3423..4ffce62 100644
--- a/src/H5Dselect.c
+++ b/src/H5Dselect.c
@@ -227,6 +227,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 */
diff --git a/src/H5I.c b/src/H5I.c
index ca9ff61..345c010 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -355,6 +355,9 @@ H5Itype_exists(H5I_type_t type)
FUNC_ENTER_API(FAIL)
H5TRACE1("t", "It", type);
+ if(H5I_IS_LIB_TYPE(type))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+
if (type <= H5I_BADID || type >= H5I_next_type)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")