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

@@ -1413,6 +1413,9 @@ H5S__point_deserialize(H5S_t **space, const uint8_t **p)
/* Decode version */
UINT32DECODE(pp, version);
if(version < H5S_POINT_VERSION_1 || version > H5S_POINT_VERSION_LATEST)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for point selection")
if(version >= (uint32_t)H5S_POINT_VERSION_2)
/* Decode size of point info */
enc_size = *(pp)++;