summaryrefslogtreecommitdiffstats
path: root/src/H5Topaque.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Topaque.c')
-rw-r--r--src/H5Topaque.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Topaque.c b/src/H5Topaque.c
index 58535a2..0121957 100644
--- a/src/H5Topaque.c
+++ b/src/H5Topaque.c
@@ -86,6 +86,8 @@ H5Tset_tag(hid_t type_id, const char *tag)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an opaque data type")
if (!tag)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no tag")
+ if (HDstrlen(tag) >= H5T_OPAQUE_TAG_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "tag too long")
/* Commit */
H5MM_xfree(dt->shared->u.opaque.tag);