diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-10-01 01:42:43 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2016-11-29 23:42:31 (GMT) |
commit | c179e2d562e11a9f5440de2db9224bba34cd8197 (patch) | |
tree | b95228d1d1918436128b980303cf33f8d51fbe7a /src | |
parent | 58182dc03735ae0b7bca0e0463204cf7ee13e9c1 (diff) | |
download | hdf5-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |