summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Oattr.c7
-rw-r--r--src/H5Ppublic.h11
2 files changed, 10 insertions, 8 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index ac643ea..cb06f25 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -221,10 +221,6 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u
else
p += attr->shared->ds_size;
- /* Get the datatype's size */
- if (0 == (dt_size = H5T_get_size(attr->shared->dt)))
- HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "unable to get datatype size")
-
/* Get the datatype & dataspace sizes */
if (0 == (dt_size = H5T_get_size(attr->shared->dt)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "unable to get datatype size")
@@ -234,6 +230,9 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u
/* Compute the size of the data */
H5_CHECKED_ASSIGN(attr->shared->data_size, size_t, ds_size * (hsize_t)dt_size, hsize_t);
+ /* Check if multiplication has overflown */
+ if ((attr->shared->data_size / dt_size) != ds_size)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_OVERFLOW, NULL, "data size exceeds addressable range")
/* Go get the data */
if (attr->shared->data_size) {
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 04b8f0e..33a1df9 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -2321,10 +2321,13 @@ H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned level);
* (#H5Z_FILTER_DEFLATE) and the Fletcher32 error detection filter
* (#H5Z_FILTER_FLETCHER32).
*
- * The array \p c_values contains \p cd_nelmts integers which are
- * auxiliary data for the filter. The integer values will be
- * stored in the dataset object header as part of the filter
- * information.
+ * The array \p cd_values contains \p cd_nelmts unsigned integers
+ * which are auxiliary data for the filter. The values are typically
+ * used as parameters to control the filter. In a filter's
+ * \p set_local method (called from \p H5Dcreate), the values are
+ * interpreted and possibly modified before they are used to control
+ * the filter. These, possibly modified values, are then stored in
+ * the dataset object header as auxiliary data for the filter.
*
* The \p flags argument is a bit vector with the following
* fields specifying certain general properties of the filter: