summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-09-23 15:58:37 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-09-23 15:58:37 (GMT)
commita7fb4ede8601e135433ef2d23bf4bbb466d9f58d (patch)
treeb35e87a96d2fa19ef067e742fe7d7804f5224b4a /src
parent51c6e5b595e2c413f8e035d0737cf9210d7f9d91 (diff)
parent748d6f318c5ebe4fa7ee5d8e4ca2681d69792b70 (diff)
downloadhdf5-a7fb4ede8601e135433ef2d23bf4bbb466d9f58d.zip
hdf5-a7fb4ede8601e135433ef2d23bf4bbb466d9f58d.tar.gz
hdf5-a7fb4ede8601e135433ef2d23bf4bbb466d9f58d.tar.bz2
Merge pull request #42 in HDFFV/hdf5 from ~NFORTNE2/hdf5_nf:talos-0179 to develop
* commit '748d6f318c5ebe4fa7ee5d8e4ca2681d69792b70': 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 eae542b..799f475 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -311,7 +311,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 */