summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-05-08 21:12:32 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-05-08 21:12:32 (GMT)
commit224fae1bb26ebae7169f25d824dbe7f20cc59c0d (patch)
tree344dd238153e5e512dc050cd43950fe2055cf82c /src
parent977c5fadbadc0d2d83cca6428a8d4b99f41f403c (diff)
downloadhdf5-224fae1bb26ebae7169f25d824dbe7f20cc59c0d.zip
hdf5-224fae1bb26ebae7169f25d824dbe7f20cc59c0d.tar.gz
hdf5-224fae1bb26ebae7169f25d824dbe7f20cc59c0d.tar.bz2
[svn-r6839] Purpose: feature protection
Description: H5Sselect_hyperslab and H5Sselect_elements didn't check scalar dataspaces. Solution: put error detection in those functions. Platforms tested: eirene(simple change).
Diffstat (limited to 'src')
-rw-r--r--src/H5Shyper.c2
-rw-r--r--src/H5Spoint.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index c8b019d..5866169 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -4784,6 +4784,8 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hssize_t start[],
/* Check args */
if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ if (H5S_SCALAR==H5S_get_simple_extent_type(space))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space");
if(start==NULL || count==NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified");
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index 9eab6bc..7c45a11 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -1186,6 +1186,8 @@ H5Sselect_elements(hid_t spaceid, H5S_seloper_t op, size_t num_elem,
/* Check args */
if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ if (H5S_SCALAR==H5S_get_simple_extent_type(space))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space");
if(coord==NULL || num_elem==0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "elements not specified");
if(!(op==H5S_SELECT_SET || op==H5S_SELECT_APPEND || op==H5S_SELECT_PREPEND))