Fixes a size mismatch when copying old-style to new-style references

This commit is contained in:
Dana Robinson 2020-08-12 11:38:04 -07:00
parent ed51c0e302
commit 4f0283db78
3 changed files with 6 additions and 6 deletions

View File

@ -822,7 +822,7 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token,
HDassert(token_size);
HDassert(token_size <= H5O_MAX_TOKEN_SIZE);
H5MM_memcpy(&ref->info.obj.token, obj_token, sizeof(H5O_token_t));
H5MM_memcpy(&ref->info.obj.token, obj_token, token_size);
HDassert(token_size <= 255);
ref->token_size = (uint8_t)token_size;

View File

@ -3641,7 +3641,7 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if(0 == (buf_size = src->shared->u.atomic.u.r.cls->getsize(
src->shared->u.atomic.u.r.file, s, src->shared->size,
dst->shared->u.atomic.u.r.file, &dst_copy)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect size")
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to obtain size of reference")
/* Check if conversion buffer is large enough, resize if necessary. */
if(conv_buf_size < buf_size) {

View File

@ -2720,10 +2720,10 @@ test_reference_compat_conv(void)
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
hobj_ref_t *wbuf_obj; /* Buffer to write to disk */
H5R_ref_t *rbuf_obj; /* Buffer read from disk */
hdset_reg_ref_t *wbuf_reg; /* Buffer to write to disk */
H5R_ref_t *rbuf_reg; /* Buffer read from disk */
hobj_ref_t *wbuf_obj = NULL; /* Buffer to write to disk */
H5R_ref_t *rbuf_obj = NULL; /* Buffer read from disk */
hdset_reg_ref_t *wbuf_reg = NULL; /* Buffer to write to disk */
H5R_ref_t *rbuf_reg = NULL; /* Buffer read from disk */
H5O_type_t obj_type; /* Object type */
herr_t ret; /* Generic return value */
unsigned int i; /* Counter */