diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2008-06-19 19:47:57 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2008-06-19 19:47:57 (GMT) |
commit | 2664f5dc25bbe48c2017ee8fab2f77c0ce7e1700 (patch) | |
tree | 0dfb9de7ff2fb6fb8f460cd4dba32fdfe9bfc7cc | |
parent | 82f111d89bcec52386b68e729d82d10e088ab915 (diff) | |
download | hdf5-2664f5dc25bbe48c2017ee8fab2f77c0ce7e1700.zip hdf5-2664f5dc25bbe48c2017ee8fab2f77c0ce7e1700.tar.gz hdf5-2664f5dc25bbe48c2017ee8fab2f77c0ce7e1700.tar.bz2 |
[svn-r15242] Purpose: Bug Fix
Description: Journal entry data was not getting copied correctly before being
converted into hex, and thus journal entries were getting
corrupted. H5C2_jb__journal_entry now uses HDmemcpy, which should
fix the issue.
Tested: kagiso
-rw-r--r-- | src/H5C2journal.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/H5C2journal.c b/src/H5C2journal.c index 84dcd8f..73e0b55 100644 --- a/src/H5C2journal.c +++ b/src/H5C2journal.c @@ -2897,7 +2897,7 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, char * hexdata = NULL; size_t hexlength; herr_t ret_value = SUCCEED; - uint8_t * bodydata = strdup(body); + uint8_t * bodydata; FUNC_ENTER_NOAPI(H5C2_jb__journal_entry, FAIL) #if 0 /* JRM */ @@ -2908,6 +2908,15 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, HDassert(struct_ptr); HDassert(bodydata); HDassert(struct_ptr->magic == H5C2__H5C2_JBRB_T_MAGIC); + + /* Make a copy of body data */ + if ( (bodydata = H5MM_malloc(length)) == NULL ) { + + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ + "allocation of assembly buffer failed."); + } + + HDmemcpy(bodydata, body, length); /* Verify that the supplied transaction is in progress */ if ( ( struct_ptr->trans_in_prog != TRUE ) || |