summaryrefslogtreecommitdiffstats
path: root/src/H5Rint.c
diff options
context:
space:
mode:
authorQuincey Koziol <quincey@koziol.cc>2020-12-19 18:37:45 (GMT)
committerGitHub <noreply@github.com>2020-12-19 18:37:45 (GMT)
commit05f6f2becd9f30cc6ce3f17c31cf51369e92536a (patch)
tree7839bdecde750a5485ba82d5d9d68f42da8d66e9 /src/H5Rint.c
parent996d07102d426ae673dff0bb49409e5ae4d1aecf (diff)
downloadhdf5-05f6f2becd9f30cc6ce3f17c31cf51369e92536a.zip
hdf5-05f6f2becd9f30cc6ce3f17c31cf51369e92536a.tar.gz
hdf5-05f6f2becd9f30cc6ce3f17c31cf51369e92536a.tar.bz2
Avoid aligned access for references by decoding into temporary buffer and then copying the result into the actual buffer. Update test to be more thorough with using compound datatype fields everywhere. (#206)
Diffstat (limited to 'src/H5Rint.c')
-rw-r--r--src/H5Rint.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 40f48a1..00ea82f 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -1041,12 +1041,13 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref)
FUNC_ENTER_PACKAGE
+ /* Sanity checks */
HDassert(buf);
HDassert(nbytes);
HDassert(ref);
- buf_size = *nbytes;
/* Don't decode if buffer size isn't big enough */
+ buf_size = *nbytes;
if (buf_size < H5R_ENCODE_HEADER_SIZE)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small")
@@ -1107,6 +1108,7 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref)
H5R_LOG_DEBUG("Decoded reference, filename=%s, obj_addr=%s, encode size=%u", ref->info.obj.filename,
H5R__print_token(ref->info.obj.token), ref->encode_size);
+ /* Set output info */
*nbytes = decode_size;
done: