summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-09-08 18:47:22 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-10-06 18:56:01 (GMT)
commit73640612aad91d3f04e4d8f1ea71d42acbc85f6e (patch)
tree77a9ed95bda9ef883c011b8bcdcceb55c04dd407 /src
parent43ec23616697ce0ea3f99e40900fec55fe9107ef (diff)
downloadhdf5-73640612aad91d3f04e4d8f1ea71d42acbc85f6e.zip
hdf5-73640612aad91d3f04e4d8f1ea71d42acbc85f6e.tar.gz
hdf5-73640612aad91d3f04e4d8f1ea71d42acbc85f6e.tar.bz2
Change check for number of dimensions for old-style arrays in datatype decoding routine from an assertion to an if/HGOTO_ERROR check, since it is inappropriate to assert the contents of a file will be what we expect.
Diffstat (limited to 'src')
-rw-r--r--src/H5Odtype.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 2284634..67f2fca 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -310,7 +310,11 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
if(version == H5O_DTYPE_VERSION_1) {
/* Decode the number of dimensions */
ndims = *(*pp)++;
- HDassert(ndims <= 4);
+
+ /* Check that ndims is valid */
+ if(ndims > 4)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid number of dimensions for array")
+
*pp += 3; /*reserved bytes */
/* Skip dimension permutation */