diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-02-27 04:16:13 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-02-27 04:16:13 (GMT) |
commit | ce005900d6ad539cc7556ab225b771d24632f4f1 (patch) | |
tree | fe1eedb554b5024f911ab39994ccd4db8e63687d /src | |
parent | 9ea358d971ae45698dba6794583a39c4023085ad (diff) | |
download | hdf5-ce005900d6ad539cc7556ab225b771d24632f4f1.zip hdf5-ce005900d6ad539cc7556ab225b771d24632f4f1.tar.gz hdf5-ce005900d6ad539cc7556ab225b771d24632f4f1.tar.bz2 |
Fix for HDFFV-10357 (CVE-2017-17508).
Diffstat (limited to 'src')
-rw-r--r-- | src/H5T.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |