diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-18 23:36:49 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-18 23:36:49 (GMT) |
commit | f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7 (patch) | |
tree | b5f709e5415db2f1a9287b43565fea826b3018f5 /src/H5Osdspace.c | |
parent | 4a17aff4085ad6ee265b95730aca3f493056dec8 (diff) | |
parent | 7aa4eb1b04014f1ad7e1c857ca6509aeeb6c0ae7 (diff) | |
download | hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.zip hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.gz hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_func_enter_vol
Plus initial steps toward merging API context push into FUNC_ENTER_API* macros
Diffstat (limited to 'src/H5Osdspace.c')
-rw-r--r-- | src/H5Osdspace.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 22ab4fe..74fa72e 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -26,7 +26,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); + unsigned *ioflags, size_t p_size, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); @@ -109,7 +109,8 @@ H5FL_ARR_EXTERN(hsize_t); --------------------------------------------------------------------------*/ static void * H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ unsigned flags, version; @@ -438,7 +439,7 @@ H5O__sdspace_free(void *mesg) */ static herr_t H5O_sdspace_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 H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */ H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ @@ -449,6 +450,13 @@ H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, /* check args */ HDassert(file_src); HDassert(src_space_extent); + HDassert(cpy_info); + HDassert(cpy_info->file_dst); + + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ + if(src_space_extent->version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) + HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "dataspace message version out of bounds") /* If the user data is non-NULL, assume we are copying a dataset * and make a copy of the dataspace extent for later in the object copying |