diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2020-03-13 16:22:22 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2020-03-13 16:22:22 (GMT) |
commit | 81b1ed4e1724b8a6a731ab2b8fb03234a8b49d15 (patch) | |
tree | 038db381bcae2713b24a7f1f50e73d54faad354d /src/H5Sall.c | |
parent | a24b0c4a848c08454831ad9c561e234c1248a821 (diff) | |
download | hdf5-81b1ed4e1724b8a6a731ab2b8fb03234a8b49d15.zip hdf5-81b1ed4e1724b8a6a731ab2b8fb03234a8b49d15.tar.gz hdf5-81b1ed4e1724b8a6a731ab2b8fb03234a8b49d15.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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c index 4a4245d..77fb582 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -690,6 +690,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; |