diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2016-10-06 16:06:06 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2016-10-06 16:06:06 (GMT) |
commit | b130135fc2a3192c16fe14a5d85a4e59d4f46985 (patch) | |
tree | 4497a604aae9decc27e7351ca75674dc7038228a | |
parent | f115eba79ea13882ec3d62e03fa7149879be2cab (diff) | |
parent | 4fe02fbc51944fc9fa392c8ce7e229b8781d70ab (diff) | |
download | hdf5-b130135fc2a3192c16fe14a5d85a4e59d4f46985.zip hdf5-b130135fc2a3192c16fe14a5d85a4e59d4f46985.tar.gz hdf5-b130135fc2a3192c16fe14a5d85a4e59d4f46985.tar.bz2 |
Merge pull request #60 in HDFFV/hdf5 from ~NFORTNE2/hdf5_nf:hdf5_1_8 to hdf5_1_8
* commit '4fe02fbc51944fc9fa392c8ce7e229b8781d70ab':
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 622a18e..2284634 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -518,7 +518,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) |