Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > b2a9cff828d5d72e3b98199430d30945 > files > 6

hdf5-1.8.13-4.1.mga5.src.rpm

commit bc10fd219e60fc4b9df7d80567ecb1e39ae5b6e3
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date:   Thu Sep 8 13:47:22 2016 -0500

    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.

Index: hdf5/src/H5Odtype.c
===================================================================
--- hdf5.orig/src/H5Odtype.c
+++ hdf5/src/H5Odtype.c
@@ -310,7 +310,11 @@ H5O_dtype_decode_helper(H5F_t *f, unsign
                     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 */