diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-10-05 05:16:59 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-10-05 05:16:59 (GMT) |
commit | 376f8390b6df7d3250afc1b059bcd899ca0aee51 (patch) | |
tree | b095e06beca15ae757ba013597c7d473f151c564 /src/H5SMcache.c | |
parent | 06e02a2a81090d518846e29f22f35f9fc2bfc961 (diff) | |
download | hdf5-376f8390b6df7d3250afc1b059bcd899ca0aee51.zip hdf5-376f8390b6df7d3250afc1b059bcd899ca0aee51.tar.gz hdf5-376f8390b6df7d3250afc1b059bcd899ca0aee51.tar.bz2 |
[svn-r27952] Merge of r27320 from the trunk
Fix uninitialized memory write valgrind errors in trunk. Did this by modifying
metadata cache clients to clear unused memory in the buffer after serializing.
Tested on: Ubuntu 15.04 (Linux 3.19 x86_64), gcc 4.9.2, MPICH 3.1.4
parallel w/ fortran
serial w/ fortran and C++
Diffstat (limited to 'src/H5SMcache.c')
-rw-r--r-- | src/H5SMcache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 54c2b41..b5c3215 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -766,13 +766,13 @@ H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t len, computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); UINT32ENCODE(image, computed_chksum); + /* sanity check */ + HDassert((size_t)(image - (uint8_t *)_image) <= list->header->list_size); + #ifdef H5_CLEAR_MEMORY HDmemset(image, 0, (list->header->list_size - (size_t)(image - (uint8_t *)_image))); #endif /* H5_CLEAR_MEMORY */ - /* sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= list->header->list_size); - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__cache_list_serialize() */ |