summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2004-07-27 16:55:19 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2004-07-27 16:55:19 (GMT)
commit5a19f181b35a0928d23c7c12fd7a0698b465855b (patch)
tree3516b75287980167182a4185e167a0ddff9bbf91 /src/H5A.c
parent7a07c6cc133e62f5f00e6a4baf214c9011657800 (diff)
downloadhdf5-5a19f181b35a0928d23c7c12fd7a0698b465855b.zip
hdf5-5a19f181b35a0928d23c7c12fd7a0698b465855b.tar.gz
hdf5-5a19f181b35a0928d23c7c12fd7a0698b465855b.tar.bz2
[svn-r8953]
Purpose: Bug fix Description: When a simple dataspace is created, its extent should be set before using it, or it will silently function as a NULL dataspace. Solution: Added checks on user-supplied dataspaces. Now dataspaces without extents set will throw errors; users must explicitly set a dataspace to be NULL. Platforms tested: sleipnir, windows
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 21c3390..872d3fe 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -224,6 +224,10 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type,
assert(type);
assert(space);
+ /* Check if the dataspace has an extent set (or is NULL) */
+ if( !(H5S_has_extent(space)) )
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace extent has not been set")
+
/* Build the attribute information */
if((attr = H5MM_calloc(sizeof(H5A_t)))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for attribute info")