diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-01-15 17:22:15 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-01-15 17:22:15 (GMT) |
commit | e5dac2010c173cab81b70b2ba0e9ba03d2b94b91 (patch) | |
tree | 289b1d1bcf34918c245859fe8d4e54bcdb13ead0 | |
parent | e36046999f277cc7330c4d7ca621cf51d75d2650 (diff) | |
download | hdf5-e5dac2010c173cab81b70b2ba0e9ba03d2b94b91.zip hdf5-e5dac2010c173cab81b70b2ba0e9ba03d2b94b91.tar.gz hdf5-e5dac2010c173cab81b70b2ba0e9ba03d2b94b91.tar.bz2 |
[svn-r14418] Description:
Handled truncated files better, when the truncation falls in decoding a
local heap.
Tested on:
Mac OS X/32 10.5.1 (amazon)
-rw-r--r-- | src/H5HL.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -284,9 +284,12 @@ H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, if (!heap->freelist) heap->freelist = fl; p = heap->chunk + sizeof_hdr + free_block; + H5F_DECODE_LENGTH(f, p, free_block); - H5F_DECODE_LENGTH(f, p, fl->size); + if(free_block == 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "free block size is zero?"); + H5F_DECODE_LENGTH(f, p, fl->size); if (fl->offset + fl->size > heap->disk_alloc) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad heap free list"); } |