summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2015-10-01 01:42:43 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2016-11-29 23:42:31 (GMT)
commitc179e2d562e11a9f5440de2db9224bba34cd8197 (patch)
treeb95228d1d1918436128b980303cf33f8d51fbe7a /src
parent58182dc03735ae0b7bca0e0463204cf7ee13e9c1 (diff)
downloadhdf5-c179e2d562e11a9f5440de2db9224bba34cd8197.zip
hdf5-c179e2d562e11a9f5440de2db9224bba34cd8197.tar.gz
hdf5-c179e2d562e11a9f5440de2db9224bba34cd8197.tar.bz2
Fix H5Rget_name with H5R_ATTR to return size if buf is NULL
Diffstat (limited to 'src')
-rw-r--r--src/H5R.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 59b1250..3598ccf 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -1287,8 +1287,10 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty
copy_len = MIN(attr_name_len, size - 1);
/* Get the attribute name */
- HDmemcpy(name, p, copy_len);
- name[copy_len] = '\0';
+ if (name) {
+ HDmemcpy(name, p, copy_len);
+ name[copy_len] = '\0';
+ }
ret_value = (ssize_t)copy_len;
} /* end case */
break;