diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-07-26 19:12:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-07-26 19:12:22 (GMT) |
commit | 6f3fe31a4c04b15ae7c783ac6295c4cfc532f8e4 (patch) | |
tree | ea53de316e332873371de4d5c83d53b8e1a6988a /src | |
parent | 76cf163f9617eecb02cbca323cc8be60c8490091 (diff) | |
download | hdf5-6f3fe31a4c04b15ae7c783ac6295c4cfc532f8e4.zip hdf5-6f3fe31a4c04b15ae7c783ac6295c4cfc532f8e4.tar.gz hdf5-6f3fe31a4c04b15ae7c783ac6295c4cfc532f8e4.tar.bz2 |
[svn-r14020] Description:
Correct error in size of v2 B-tree metadata prefix, which could cause too
many entries to get inserted into a node, eventually causing either a file
corruption bug (if debugging asserts were off) or a core dump on the assertion
which checked this.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B2cache.c | 2 | ||||
-rw-r--r-- | src/H5B2pkg.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 86592c5..d8679aa 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -647,6 +647,7 @@ H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr /* B-tree type */ *p++ = shared->type->id; + HDassert((size_t)(p - shared->page) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); /* Serialize records for internal node */ native = internal->int_native; @@ -982,6 +983,7 @@ H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5 /* b-tree type */ *p++ = shared->type->id; + HDassert((size_t)(p - shared->page) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); /* Serialize records for leaf node */ native = leaf->leaf_native; diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 3dfbe41..43fab1f 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -69,6 +69,7 @@ #define H5B2_METADATA_PREFIX_SIZE ( \ H5B2_SIZEOF_MAGIC /* Signature */ \ + 1 /* Version */ \ + + 1 /* Tree type */ \ + H5B2_SIZEOF_CHKSUM /* Metadata checksum */ \ ) @@ -78,7 +79,6 @@ H5B2_METADATA_PREFIX_SIZE \ \ /* Header specific fields */ \ - + 1 /* Tree type */ \ + 4 /* Node size, in bytes */ \ + 2 /* Record size, in bytes */ \ + 2 /* Depth of tree */ \ |