summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-12-05 18:35:20 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-12-05 18:35:20 (GMT)
commit0662f060b2e5917b70360ed10aca3993b60f1434 (patch)
treeeca4dc24036fcc3f3365b0cd2045b23f13fa3c25 /src/H5Shyper.c
parent3726715625d146ddffc4236b8de5cc601c87b737 (diff)
downloadhdf5-0662f060b2e5917b70360ed10aca3993b60f1434.zip
hdf5-0662f060b2e5917b70360ed10aca3993b60f1434.tar.gz
hdf5-0662f060b2e5917b70360ed10aca3993b60f1434.tar.bz2
Fix the segmentation fault when h5dump "vds_virt_0.h5", which is a test file produced by test/vds.c in the develop
branch. The fix: verify the decoded version for hyperslab selection is within the correct range.
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 55913e0..4f96197 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -2481,6 +2481,9 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p)
/* Decode version */
UINT32DECODE(pp, version);
+ if(version < H5S_HYPER_VERSION_1 || version > H5S_HYPER_VERSION_LATEST)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for hyperslab selection")
+
if(version >= (uint32_t)H5S_HYPER_VERSION_2) {
/* Decode flags */
flags = *(pp)++;