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
This commit is contained in:
Vailin Choi
2020-03-13 11:22:22 -05:00
parent a24b0c4a84
commit 81b1ed4e17
5 changed files with 23 additions and 5 deletions

View File

@@ -648,6 +648,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;