diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-06-10 17:18:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-06-10 17:18:06 (GMT) |
commit | 1c53303fd358be86166c14e76c154a477d0107b5 (patch) | |
tree | 08dd67d03f3bac833c7b1a9641ce11daf7021dcd /test | |
parent | 6aca9b93f20b6e9692d4fc686d1b836be3952626 (diff) | |
download | hdf5-1c53303fd358be86166c14e76c154a477d0107b5.zip hdf5-1c53303fd358be86166c14e76c154a477d0107b5.tar.gz hdf5-1c53303fd358be86166c14e76c154a477d0107b5.tar.bz2 |
[svn-r5569] 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')
-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 0183e51..64cfee3 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; |