summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2018-03-05 21:36:27 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2018-03-05 21:36:27 (GMT)
commita8bea5fd26bbb5ac090c3f137b04b50f431048c6 (patch)
tree1b8c3fa11b604030ade1642730d2ffa10929394c /src
parent3dcc827771d147146a714831f63fbe12af99ce30 (diff)
parent3b0e80c1dcdf664f56829383aa3bc9e8ecc0f2c6 (diff)
downloadhdf5-a8bea5fd26bbb5ac090c3f137b04b50f431048c6.zip
hdf5-a8bea5fd26bbb5ac090c3f137b04b50f431048c6.tar.gz
hdf5-a8bea5fd26bbb5ac090c3f137b04b50f431048c6.tar.bz2
Merge branch 'develop' into avoid_trunc_beta
Diffstat (limited to 'src')
-rw-r--r--src/H5T.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index eca0132..ffa7bcb 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -5211,6 +5211,11 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc)
/* Check if the field changed size */
if(old_size != memb_type->shared->size) {
+
+ /* Fail if the old_size is zero */
+ if (0 == old_size)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "old_size of zero would cause division by zero");
+
/* Adjust the size of the member */
dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size;