summaryrefslogtreecommitdiffstats
path: root/src/H5Odtype.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-09-01 22:24:24 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-09-01 22:24:24 (GMT)
commitb1eb1b3ee8693e2a56b074315b521c66255acca1 (patch)
tree85bf10069d3c2739c0f548b20d9fce16fb9379ed /src/H5Odtype.c
parent130e0a6638351bbdb7e53a82e5bdb810fd13a903 (diff)
downloadhdf5-b1eb1b3ee8693e2a56b074315b521c66255acca1.zip
hdf5-b1eb1b3ee8693e2a56b074315b521c66255acca1.tar.gz
hdf5-b1eb1b3ee8693e2a56b074315b521c66255acca1.tar.bz2
Replace assertion in H5O_dtype_decode_helper for number of array dimensions with a check and error. The assertion was inappropriate because it is operating on data read from the file, which the library does not always have direct control of.
Diffstat (limited to 'src/H5Odtype.c')
-rw-r--r--src/H5Odtype.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index e51d319..eae542b 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -519,7 +519,8 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
dt->shared->u.array.ndims = *(*pp)++;
/* Double-check the number of dimensions */
- HDassert(dt->shared->u.array.ndims <= H5S_MAX_RANK);
+ if(dt->shared->u.array.ndims > H5S_MAX_RANK)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "too many dimensions for array datatype")
/* Skip reserved bytes, if version has them */
if(version < H5O_DTYPE_VERSION_3)