summaryrefslogtreecommitdiffstats
path: root/src/H5Rint.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-12-27 01:04:13 (GMT)
committerGitHub <noreply@github.com>2020-12-27 01:04:13 (GMT)
commit16aa92d535c9fddcd840e2a6c386c5a00ce49164 (patch)
tree23b8711e26312864b0c003e92873873fb70f9506 /src/H5Rint.c
parent81fdb7b49307290633e543a3fa08a67fc836fc1d (diff)
downloadhdf5-16aa92d535c9fddcd840e2a6c386c5a00ce49164.zip
hdf5-16aa92d535c9fddcd840e2a6c386c5a00ce49164.tar.gz
hdf5-16aa92d535c9fddcd840e2a6c386c5a00ce49164.tar.bz2
Hdf5 1 12 - Fix unaligned access to reference buffer during datatype conversion on 64-bit Solaris (#231)
* Snapshot version 1.12 release 1-3. Update version to 1.12.1-4. * First cut of the H5 public API documentation. (#80) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Full set of current H5F documentation. (#105) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Migrated documentation for SWMR functions. * Catching up on MDC functions. * Integrated the H5F MDC function documentation. * Added MDC and parallel H5F functions. * Slightly updated main page. * Added doxygen/dox/H5AC_cache_config_t.dox to MANIFEST. * Doxygen - added (mostly) beginner functions (#112) * Doxygen - added (mostly) beginner functions * Removed duplicate H5Pset_szip function * Add src/H5module.h to MANIFEST. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * 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) Co-authored-by: Gerd Heber <gheber@hdfgroup.org> Co-authored-by: bljhdf <58825073+bljhdf@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Quincey Koziol <quincey@koziol.cc>
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 60f8131..93645a1 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: