diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-06-10 17:07:38 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-06-10 17:07:38 (GMT) |
commit | 7a272fc66038db933a4df9adbf599e54be94614c (patch) | |
tree | d1f38f4b4ab5a4c364d29b9785a35294bd975a15 /src/H5T.c | |
parent | 8bb2a0cfd8826fa11378335ca7bb381ca2a89d17 (diff) | |
download | hdf5-7a272fc66038db933a4df9adbf599e54be94614c.zip hdf5-7a272fc66038db933a4df9adbf599e54be94614c.tar.gz hdf5-7a272fc66038db933a4df9adbf599e54be94614c.tar.bz2 |
[svn-r5567] Purpose:
Bug fix (bug #777)
Description:
Current code allows a compound datatype to be inserted into itself.
Solution:
Check if the ID for the member is the same as the ID for the compound
datatype and reject it if so.
Platforms tested:
FreeBSD 4.5 (sleipnir)
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -4315,6 +4315,8 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id) H5TRACE4("e","iszi",parent_id,name,offset,member_id); /* Check args */ + if (parent_id==member_id) + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't insert compound datatype within itself"); if (H5I_DATATYPE != H5I_get_type(parent_id) || NULL == (parent = H5I_object(parent_id)) || H5T_COMPOUND != parent->type) { |