diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2019-12-05 22:09:49 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2019-12-05 22:09:49 (GMT) |
commit | f3686baaf0de37c2a4db6c3ec68d3a1be7c600e5 (patch) | |
tree | 47ba661bf50d06cf8e1ae7337abcff485b274e3d /src | |
parent | 9d24eefaf71bae79ab3e483a608ddb8deff17b39 (diff) | |
download | hdf5-f3686baaf0de37c2a4db6c3ec68d3a1be7c600e5.zip hdf5-f3686baaf0de37c2a4db6c3ec68d3a1be7c600e5.tar.gz hdf5-f3686baaf0de37c2a4db6c3ec68d3a1be7c600e5.tar.bz2 |
Verify the decoded version for hyperslab selection.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Shyper.c | 3 | ||||
-rw-r--r-- | src/H5Spkg.h | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 5147289..e9a7133 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -4250,6 +4250,9 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) /* Decode version */ UINT32DECODE(pp, version); + if(version < H5S_HYPER_VERSION_1 || version > H5S_HYPER_VERSION_LATEST) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for hyperslab selection") + if(version >= (uint32_t)H5S_HYPER_VERSION_2) { /* Decode flags */ flags = *(pp)++; diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 278f08d..6a78e52 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -41,9 +41,10 @@ #define H5S_SELECT_FLAG_BITS (H5S_HYPER_REGULAR) /* Versions for H5S_SEL_HYPER selection info */ -#define H5S_HYPER_VERSION_1 1 -#define H5S_HYPER_VERSION_2 2 -#define H5S_HYPER_VERSION_3 3 +#define H5S_HYPER_VERSION_1 1 +#define H5S_HYPER_VERSION_2 2 +#define H5S_HYPER_VERSION_3 3 +#define H5S_HYPER_VERSION_LATEST H5S_HYPER_VERSION_3 /* Versions for H5S_SEL_POINTS selection info */ #define H5S_POINT_VERSION_1 1 |