summaryrefslogtreecommitdiffstats
path: root/src/H5Sall.c
diff options
context:
space:
mode:
authorvchoi <vchoi@jelly.ad.hdfgroup.org>2020-03-12 22:20:23 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2020-03-12 22:23:53 (GMT)
commitf33bb733be2da42672b4b0264cd4c6318ba35e9a (patch)
tree6a5c914680e21de41a1e2506957d1d4db214be92 /src/H5Sall.c
parent25a67c538c8014db867cba386c959fb9e7b714e8 (diff)
downloadhdf5-f33bb733be2da42672b4b0264cd4c6318ba35e9a.zip
hdf5-f33bb733be2da42672b4b0264cd4c6318ba35e9a.tar.gz
hdf5-f33bb733be2da42672b4b0264cd4c6318ba35e9a.tar.bz2
Fix issues when deserializing point/all/none selection with version beyond the library's supported version:
(1) Verify the decoded version before proceeding further with deserialization (2) Close the dataspace if errors occurred after opening the dataspace
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r--src/H5Sall.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c
index 1738615..8262f9b 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -580,6 +580,9 @@ H5S__all_deserialize(H5S_t **space, const uint8_t **p)
/* Decode version */
UINT32DECODE(*p, version);
+ if(version < H5S_ALL_VERSION_1 || version > H5S_ALL_VERSION_LATEST)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for all selection")
+
/* Skip over the remainder of the header */
*p += 8;