summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-01-03 04:35:26 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-01-03 15:35:44 (GMT)
commit659dd9bccf69f32bfdd01dc49410116ec5c1b0bb (patch)
tree1398cf5b2d9c22cd38bd6e364ba3dde20562532c /src
parentc820502e69b8c3222bbf1162d21820bebcf71202 (diff)
downloadhdf5-659dd9bccf69f32bfdd01dc49410116ec5c1b0bb.zip
hdf5-659dd9bccf69f32bfdd01dc49410116ec5c1b0bb.tar.gz
hdf5-659dd9bccf69f32bfdd01dc49410116ec5c1b0bb.tar.bz2
Align H5Lcreate_ud behavior with documentation for NULL udata pointer
Add test for H5Lcreate_ud fix
Diffstat (limited to 'src')
-rw-r--r--src/H5L.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5L.c b/src/H5L.c
index 33e561a..1f45740 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -648,6 +648,8 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified")
if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class")
+ if(!udata && udata_size)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata cannot be NULL if udata_size is non-zero")
/* Check the group access property list */
if(H5P_DEFAULT == lcpl_id)