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 /test/dtypes.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 'test/dtypes.c')
-rw-r--r-- | test/dtypes.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 13df634..1dbd650 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -397,6 +397,9 @@ test_compound_1(void) /* Create the empty type */ if ((complex_id = H5Tcreate(H5T_COMPOUND, sizeof tmp))<0) goto error; + /* Attempt to add the new compound datatype as a field within itself */ + if (H5Tinsert(complex_id, "compound", 0, complex_id)>=0) goto error; + /* Add a couple fields */ if (H5Tinsert(complex_id, "real", HOFFSET(complex_t, re), H5T_NATIVE_DOUBLE)<0) goto error; |