diff options
author | raylu-hdf <60487644+raylu-hdf@users.noreply.github.com> | 2022-08-05 16:05:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 16:05:07 (GMT) |
commit | 54f116b42db2d2aabd6fdb58cebb99f04f106310 (patch) | |
tree | 08509670b3bb1494e27266412701397c5fea2353 /src/H5D.c | |
parent | bf07e0f2c9b381509abbde59fca8bea5445da261 (diff) | |
download | hdf5-54f116b42db2d2aabd6fdb58cebb99f04f106310.zip hdf5-54f116b42db2d2aabd6fdb58cebb99f04f106310.tar.gz hdf5-54f116b42db2d2aabd6fdb58cebb99f04f106310.tar.bz2 |
Sanity checks for H5Xcreate_anon functions to make sure the IDs passed in are valid (#1967)
* Sanity checks for H5Xcreate_anon functions to make sure the IDs passed in are valid.
* Removed unnecessary sanity checks.
Co-authored-by: songyulu <songyulu@jelly.ad.hdfgroup.org>
Diffstat (limited to 'src/H5D.c')
-rw-r--r-- | src/H5D.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -285,6 +285,11 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t else if (TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not dataset create property list ID") + if (H5P_DEFAULT == dapl_id) + dapl_id = H5P_DATASET_ACCESS_DEFAULT; + else if (TRUE != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not dataset access property list ID") + /* Set the DCPL for the API context */ H5CX_set_dcpl(dcpl_id); |