summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5HL.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5HL.c b/src/H5HL.c
index 41a361f..76775f5 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -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");
}