summaryrefslogtreecommitdiffstats
path: root/src/H5Pgcpl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-28 18:51:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-28 18:51:23 (GMT)
commit1687720a5fe51d32e1544371eaa75af162f35a31 (patch)
treea876648b981f58cd0299ee4754ae4e6620a6b1f1 /src/H5Pgcpl.c
parent0bd83631d5ed24fe948a273e8a4d4bd8f128a86c (diff)
downloadhdf5-1687720a5fe51d32e1544371eaa75af162f35a31.zip
hdf5-1687720a5fe51d32e1544371eaa75af162f35a31.tar.gz
hdf5-1687720a5fe51d32e1544371eaa75af162f35a31.tar.bz2
[svn-r12991] Description:
Reduce the size of some of the group information to more reasonable bounds. (16-bit values instead of 32-bit values). Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Pgcpl.c')
-rw-r--r--src/H5Pgcpl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c
index 16046db..cc9449a 100644
--- a/src/H5Pgcpl.c
+++ b/src/H5Pgcpl.c
@@ -235,6 +235,14 @@ H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens
FUNC_ENTER_API(H5Pset_link_phase_change, FAIL)
H5TRACE3("e","iIuIu",plist_id,max_compact,min_dense);
+ /* Range check values */
+ if(max_compact < min_dense)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "max compact value must be >= min dense value")
+ if(max_compact > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "max compact value must be < 65536")
+ if(min_dense > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "min dense value must be < 65536")
+
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
@@ -329,6 +337,12 @@ H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name
FUNC_ENTER_API(H5Pset_est_link_info, FAIL)
H5TRACE3("e","iIuIu",plist_id,est_num_entries,est_name_len);
+ /* Range check values */
+ if(est_num_entries > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "est. number of entries must be < 65536")
+ if(est_name_len > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "est. name length must be < 65536")
+
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")