summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--release_docs/RELEASE.txt11
-rw-r--r--src/H5Fsuper.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 69d9780..d5a860e 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -126,7 +126,16 @@ Bug Fixes since HDF5-1.13.1 release
===================================
Library
-------
- -
+ - Converted an assertion on (possibly corrupt) file contents to a normal
+ error check
+
+ Previously, the library contained an assertion check that a read superblock
+ doesn't contain a superblock extension message when the superblock
+ version < 2. When a corrupt HDF5 file is read, this assertion can be triggered
+ in debug builds of HDF5. In production builds, this situation could cause
+ either a library error or a crash, depending on the platform.
+
+ (JTH - 2022/07/08)
Java Library
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 4e4fe8d..6a82a6e 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -687,7 +687,9 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
/* Sanity check - superblock extension should only be defined for
* superblock version >= 2.
*/
- HDassert(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2);
+ if (sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL,
+ "invalid superblock - extension message should not be defined for version < 2")
/* Check for superblock extension being located "outside" the stored
* 'eoa' value, which can occur with the split/multi VFD.