summaryrefslogtreecommitdiffstats
path: root/src/H5Pfcpl.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2015-03-20 22:37:17 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2015-03-20 22:37:17 (GMT)
commit4de770788fd2e0d751944d7a8378778f64a72083 (patch)
tree3c8d5e751b915b45b6535ce8a5677f8a2c610d32 /src/H5Pfcpl.c
parent23afd1054486ff752e620f7596d3b4725e14f6fe (diff)
downloadhdf5-4de770788fd2e0d751944d7a8378778f64a72083.zip
hdf5-4de770788fd2e0d751944d7a8378778f64a72083.tar.gz
hdf5-4de770788fd2e0d751944d7a8378778f64a72083.tar.bz2
[svn-r26514] Fix for HDFFV-9173:
H5Pset_istore_k() will validate the "ik" value to not exceed the max v1 btree entries (2 bytes) The same check for H5Pset_sym_k() "ik" value. h5committested.
Diffstat (limited to 'src/H5Pfcpl.c')
-rw-r--r--src/H5Pfcpl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index aca589c..5fc93fd 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -517,6 +517,9 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk)
/* Set values */
if (ik > 0) {
+ if((ik * 2) >= HDF5_BTREE_IK_MAX_ENTRIES)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value exceeds maximum B-tree entries");
+
if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
btree_k[H5B_SNODE_ID] = ik;
@@ -614,6 +617,9 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik)
if (ik == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value must be positive");
+ if((ik * 2) >= HDF5_BTREE_IK_MAX_ENTRIES)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value exceeds maximum B-tree entries");
+
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");