diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-29 19:17:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-29 19:17:29 (GMT) |
commit | 6e3ff79f0c26c85a8cc444a535870a956fd02b6e (patch) | |
tree | 37b0eda7665939cf8955bd7c0a0b03da79515ac9 /src/H5Oattribute.c | |
parent | 87172f5ba1778c0b5fb7abb9dc840ff5c8694e86 (diff) | |
download | hdf5-6e3ff79f0c26c85a8cc444a535870a956fd02b6e.zip hdf5-6e3ff79f0c26c85a8cc444a535870a956fd02b6e.tar.gz hdf5-6e3ff79f0c26c85a8cc444a535870a956fd02b6e.tar.bz2 |
[svn-r19154] Description:
Bring r19153 from trunk to 1.8 branch:
Bring changes on Coverity branch back to trunk:
r19040:
Fixed coverity #440 - NULL check after dereference. We moved the NULL check up
into the IF block and changed it to assertion.
r19041:
Maintenance: Addressed Coverity issues 441 and 449 by initializing proper
variables
r19042:
In function H5O_chunk_protect (H5Ochunk.c):
- Initialize H5O_chunk_proxy_t pointers chk_proxy and ret_value.
- Free chk_proxy on error.
r19043:
Addressed coverity issues 442 - 448 by initializing pointers to NULL.
Tested on:
Mac OS X/32 10.6.4 (amazon) w/debug & production
(Too minor to require h5committest)
Diffstat (limited to 'src/H5Oattribute.c')
-rw-r--r-- | src/H5Oattribute.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index b3917ff..a64b6af 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -851,12 +851,17 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Because the attribute structure is shared now. The only situation that requires * copying the data is when the metadata cache evicts and reloads this attribute. - * The attribute structure will be different in that situation. SLU-2010/7/29 */ - if(((H5A_t *)mesg->native)->shared != udata->attr->shared) + * The shared attribute structure will be different in that situation. SLU-2010/7/29 */ + if(((H5A_t *)mesg->native)->shared != udata->attr->shared) { + /* Sanity check */ + HDassert(((H5A_t *)mesg->native)->shared->data); + HDassert(udata->attr->shared->data); + HDassert(((H5A_t *)mesg->native)->shared->data != udata->attr->shared->data); + /* (Needs to occur before updating the shared message, or the hash * value on the old & new messages will be the same) */ - HDmemcpy(((H5A_t *)mesg->native)->shared->data, udata->attr->shared->data, - udata->attr->shared->data_size); + HDmemcpy(((H5A_t *)mesg->native)->shared->data, udata->attr->shared->data, udata->attr->shared->data_size); + } /* end if */ /* Mark the message as modified */ mesg->dirty = TRUE; |