diff options
author | vchoi <vchoi@jelly.ad.hdfgroup.org> | 2020-03-12 22:20:23 (GMT) |
---|---|---|
committer | vchoi <vchoi@jelly.ad.hdfgroup.org> | 2020-03-12 22:23:53 (GMT) |
commit | f33bb733be2da42672b4b0264cd4c6318ba35e9a (patch) | |
tree | 6a5c914680e21de41a1e2506957d1d4db214be92 /src/H5Snone.c | |
parent | 25a67c538c8014db867cba386c959fb9e7b714e8 (diff) | |
download | hdf5-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/H5Snone.c')
-rw-r--r-- | src/H5Snone.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5Snone.c b/src/H5Snone.c index aa98035..0a9814c 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -555,6 +555,9 @@ H5S_none_deserialize(H5S_t **space, const uint8_t **p) /* Decode version */ UINT32DECODE(*p, version); + if(version < H5S_NONE_VERSION_1 || version > H5S_NONE_VERSION_LATEST) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for none selection") + /* Skip over the remainder of the header */ *p += 8; |