summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2012-03-25 03:24:44 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2012-03-25 03:24:44 (GMT)
commitfebf006ee2b2fcca77ce02e6b9b080b7977cfb3c (patch)
tree9d9490f8a986fdf4b015701b1e74817743fcf13d /src
parent7af54eff480565b0f0ca60d801f146c0f3a041a5 (diff)
downloadhdf5-febf006ee2b2fcca77ce02e6b9b080b7977cfb3c.zip
hdf5-febf006ee2b2fcca77ce02e6b9b080b7977cfb3c.tar.gz
hdf5-febf006ee2b2fcca77ce02e6b9b080b7977cfb3c.tar.bz2
[svn-r22139] Port r22138 from trunk to 1.8 branch.
Add check for valid number of children in H5B_decode(). See HDFFV-5897. Tested: jam, durandal (too minor for full h5committest)
Diffstat (limited to 'src')
-rw-r--r--src/H5Bcache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index c679be0..b212080 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -151,6 +151,10 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* entries used */
UINT16DECODE(p, bt->nchildren);
+ /* Check if bt->nchildren is greater than two_k */
+ if(bt->nchildren > shared->two_k)
+ HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "number of children is greater than maximum")
+
/* sibling pointers */
H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->left));
H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->right));