summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r--src/H5Sselect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index a52bb12..1150e5b 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -146,6 +146,7 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src)
/* Perform correct type of copy based on the type of selection */
switch (src->extent.type) {
+ case H5S_NULL:
case H5S_SCALAR:
/*nothing needed */
break;
@@ -251,6 +252,9 @@ H5Sget_select_npoints(hid_t spaceid)
if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
+ if (space->extent.type == H5S_NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace");
+
ret_value = H5S_get_select_npoints(space);
done:
@@ -325,6 +329,9 @@ H5Sselect_valid(hid_t spaceid)
if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataspace");
+ if (space->extent.type == H5S_NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace");
+
ret_value = H5S_select_valid(space);
done: