diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2019-03-24 19:36:32 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2019-03-24 19:36:32 (GMT) |
commit | 6e9b7ced76c921a0d82d1712d58bc5505f8fd811 (patch) | |
tree | 195f89b5d727f9632af8b60bddee5736c19ebb0c /test | |
parent | cac673138c94cdbd5faa227fe5a9867941753c93 (diff) | |
download | hdf5-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 'test')
-rw-r--r-- | test/tid.c | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -250,7 +250,9 @@ static int id_predefined_test(void ) testObj = HDmalloc(sizeof(int)); - /* Try to perform illegal functions on various predefined types */ + /* + * Attempt to perform public functions on various library types + */ H5E_BEGIN_TRY testID = H5Iregister(H5I_FILE, testObj); H5E_END_TRY @@ -291,7 +293,25 @@ static int id_predefined_test(void ) if(testErr >= 0) goto out; - /* Create a datatype ID and try to perform illegal functions on it */ + H5E_BEGIN_TRY + testErr = H5Itype_exists(H5I_GROUP); + H5E_END_TRY + + VERIFY(testErr, FAIL, "H5Itype_exists"); + if(testErr != FAIL) + goto out; + + H5E_BEGIN_TRY + testErr = H5Itype_exists(H5I_ATTR); + H5E_END_TRY + + VERIFY(testErr, FAIL, "H5Itype_exists"); + if(testErr != FAIL) + goto out; + + /* + * Create a datatype ID and try to perform illegal functions on it + */ typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); if(typeID == H5I_INVALID_HID) @@ -316,7 +336,7 @@ static int id_predefined_test(void ) H5Tclose(typeID); /* testObj was never registered as an atom, so it will not be - * automatically freed. */ + * automatically freed. */ HDfree(testObj); return 0; |