summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-09-23 15:58:05 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-09-23 15:58:05 (GMT)
commitafd8d14a1e4b201cea998d95be0edea6d99ca6cd (patch)
treeb95ca240b0c0c183a10f8bf540640c6610272f45
parentbe3ad22522825d170e50a513c2937ca69799d82a (diff)
parent62d7562fbd6c6f9f2892cc9a3894f5a68a2b6fdc (diff)
downloadhdf5-afd8d14a1e4b201cea998d95be0edea6d99ca6cd.zip
hdf5-afd8d14a1e4b201cea998d95be0edea6d99ca6cd.tar.gz
hdf5-afd8d14a1e4b201cea998d95be0edea6d99ca6cd.tar.bz2
Merge pull request #40 in HDFFV/hdf5 from ~NFORTNE2/hdf5_nf:talos-0176 to develop
* commit '62d7562fbd6c6f9f2892cc9a3894f5a68a2b6fdc': 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.
-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)