summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2019-12-05 22:11:08 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2019-12-05 22:11:08 (GMT)
commit8c9b8047ea6aafa8d2249238658d0c29724adb61 (patch)
tree68ef2a30cab4485b0568ba4c9dd648208ea96175 /src
parentbdbe010fd3fe52c2d6c305a027eb56346f5017e8 (diff)
parent1e10b3212ed5904b69d9f4c4bcb4d0122dfd7c77 (diff)
downloadhdf5-8c9b8047ea6aafa8d2249238658d0c29724adb61.zip
hdf5-8c9b8047ea6aafa8d2249238658d0c29724adb61.tar.gz
hdf5-8c9b8047ea6aafa8d2249238658d0c29724adb61.tar.bz2
Merge pull request #2079 in HDFFV/hdf5 from ~VCHOI/my_third_fork:bugfix/reference_ver_hyperslab_ver to develop
* commit '1e10b3212ed5904b69d9f4c4bcb4d0122dfd7c77': Two fixes: (1) Set the version for reference datatype messge to H5O_DTYPE_VERSION_4. (2) Verify the decoded version for hyperslab selection.
Diffstat (limited to 'src')
-rw-r--r--src/H5Shyper.c3
-rw-r--r--src/H5Spkg.h7
-rw-r--r--src/H5T.c1
3 files changed, 8 insertions, 3 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index acb8b87..1e1538e 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -4265,6 +4265,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 ba60cbf..e139bce 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
diff --git a/src/H5T.c b/src/H5T.c
index 9263158..f378357 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -254,6 +254,7 @@
dt->shared->u.atomic.u.r.rtype = H5R_OBJECT2; \
dt->shared->u.atomic.u.r.opaque = TRUE; \
dt->shared->u.atomic.u.r.version = H5R_ENCODE_VERSION; \
+ dt->shared->version = H5O_DTYPE_VERSION_4; \
}
/* Define the code templates for the "SIZE_TMPL" in the H5T_INIT_TYPE macro */