summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 9be40cc..4a104a4 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -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) {