diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-04-28 15:08:54 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-04-28 15:08:54 (GMT) |
commit | ca4f05380b0cafb6dd0ecaf89c8db09012ef3065 (patch) | |
tree | 177910879d779c694734b8177bdf4d710356f7d5 /src | |
parent | 2ad138dbb941e02c5811f0962d3a0ca6f01aa7f3 (diff) | |
download | hdf5-ca4f05380b0cafb6dd0ecaf89c8db09012ef3065.zip hdf5-ca4f05380b0cafb6dd0ecaf89c8db09012ef3065.tar.gz hdf5-ca4f05380b0cafb6dd0ecaf89c8db09012ef3065.tar.bz2 |
[svn-r18653] Bug 1741:
Added check in H5Rcreate for space_id = -1 and is region reference type.
Added test of H5R package API parameters to testhdf5 test, these test only the public API parameter checks.
Tested: local linux
Diffstat (limited to 'src')
-rw-r--r-- | src/H5R.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -309,7 +309,7 @@ herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id) { H5G_loc_t loc; /* File location */ - H5S_t *space; /* Pointer to dataspace containing region */ + H5S_t *space = NULL; /* Pointer to dataspace containing region */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(H5Rcreate, FAIL) @@ -326,6 +326,8 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") if(ref_type != H5R_OBJECT && ref_type != H5R_DATASET_REGION) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "reference type not supported") + if(space_id == (-1) && ref_type == H5R_DATASET_REGION) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reference region dataspace id must be valid") if(space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") |