diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-12 18:54:09 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-12 18:54:09 (GMT) |
commit | 7dcd7830ae11634e92113e0d50ea201ebd79a7de (patch) | |
tree | eab3ec595784d2e3812234fe456069bd874df8f4 /src | |
parent | dca1733238c6f72d2707d280e893c027734ebc27 (diff) | |
parent | 4f0283db788fc1a0db94e7825567210021b3b594 (diff) | |
download | hdf5-7dcd7830ae11634e92113e0d50ea201ebd79a7de.zip hdf5-7dcd7830ae11634e92113e0d50ea201ebd79a7de.tar.gz hdf5-7dcd7830ae11634e92113e0d50ea201ebd79a7de.tar.bz2 |
Merge pull request #2754 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:testhdf5_ref_valgrind to develop
* commit '4f0283db788fc1a0db94e7825567210021b3b594':
Fixes a size mismatch when copying old-style to new-style references
Fixes memory leads in trefer.c
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Rint.c | 2 | ||||
-rw-r--r-- | src/H5Tconv.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c index 0acc887..ae72b47 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -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; diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 15658cc..8bf36f0 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -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) { |