summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2018-03-06 00:08:28 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2018-03-06 00:08:28 (GMT)
commitb61c93acb3c5d50d379950f6e3de5040c71dd041 (patch)
treeb0681c4b629fb6a44dc3df6d4f7f174ca7cc142d /src/H5T.c
parent302053f978e38a8d4306a7c1233cdf8fd2ec28dd (diff)
parentbbadec5680c02dfa975801b964179da9b7c06362 (diff)
downloadhdf5-b61c93acb3c5d50d379950f6e3de5040c71dd041.zip
hdf5-b61c93acb3c5d50d379950f6e3de5040c71dd041.tar.gz
hdf5-b61c93acb3c5d50d379950f6e3de5040c71dd041.tar.bz2
Merge branch 'develop' into hdffv_10355
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index f06ac18..3baa193 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -5216,6 +5216,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;