diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-12-18 20:27:51 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-12-18 20:27:51 (GMT) |
commit | a74b2047c5f00637fe3aeff12c821088b911b66e (patch) | |
tree | baa9b323d4793d2f2b5ac9e244fac03a62b3f4ef | |
parent | d076556c2be250592dfc649a817d6e8f5c11b341 (diff) | |
download | hdf5-a74b2047c5f00637fe3aeff12c821088b911b66e.zip hdf5-a74b2047c5f00637fe3aeff12c821088b911b66e.tar.gz hdf5-a74b2047c5f00637fe3aeff12c821088b911b66e.tar.bz2 |
[svn-r4736] Purpose:
Bug Fix
Description:
H5Tinsert was allowing compound datatype fields to be inserted past the end
of the datatype.
Solution:
Added range check in H5T_insert
Platforms Tested:
FreeBSD 4.4 (sleipnir)
-rw-r--r-- | src/H5T.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6364,6 +6364,10 @@ H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) } } + /* Does the new member overlap the end of the compound type? */ + if(offset+total_size>parent->size) + HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "member extends past end of compound type"); + /* Increase member array if necessary */ if (parent->u.compnd.nmembs >= parent->u.compnd.nalloc) { size_t na = parent->u.compnd.nalloc + H5T_COMPND_INC; |