summaryrefslogtreecommitdiffstats
path: root/src/H5Opline.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-11-25 08:12:26 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-11-25 08:22:24 (GMT)
commit96784c9873433b57de813c5afadd5d9771103686 (patch)
treec180d5c2a0163c2c273cb72b7b7df006e7be7a3f /src/H5Opline.c
parenta7ba8af0d145fee16a758ae4150316c7f2a38263 (diff)
parentf3fd3f293f2734fea98f508f190bf531edc72f7a (diff)
downloadhdf5-96784c9873433b57de813c5afadd5d9771103686.zip
hdf5-96784c9873433b57de813c5afadd5d9771103686.tar.gz
hdf5-96784c9873433b57de813c5afadd5d9771103686.tar.bz2
(1) Merge branch 'develop' into bugfix/version_bounds
(2) Add two new options to h5repack for low and high bounds as in H5Pset_libver_bounds. (3) Modify message pre_copy callbacks so that H5Ocopy can handle version bounds check. (4) Add version bounds check for cache image feature.
Diffstat (limited to 'src/H5Opline.c')
-rw-r--r--src/H5Opline.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/H5Opline.c b/src/H5Opline.c
index c1ff183..ea913da 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -90,7 +90,7 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{
}};
/* Format version bounds for filter pipleline */
-static const unsigned H5O_pline_ver_bounds[] = {
+const unsigned H5O_pline_ver_bounds[] = {
H5O_PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */
H5O_PLINE_VERSION_2, /* H5F_LIBVER_V18 */
H5O_PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */
@@ -572,9 +572,9 @@ H5O_pline_free(void *mesg)
*/
static herr_t
H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
- hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata)
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata)
{
- const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source datatype */
+ const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */
H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */
herr_t ret_value = SUCCEED; /* Return value */
@@ -582,6 +582,11 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
/* check args */
HDassert(pline_src);
+ HDassert(cpy_info);
+ HDassert(cpy_info->file_dst);
+
+ if(pline_src->version > H5O_pline_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "pline message version out of bounds")
/* If the user data is non-NULL, assume we are copying a dataset or group
* and make a copy of the filter pipeline for later in