summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-02-08 18:00:14 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-02-08 18:00:14 (GMT)
commitc752332bfd0e9c3090f3a0c02d0253cd45c2e2ce (patch)
tree9602624e089f7e560e32a40bf98773054c1573b9 /src/H5Oattr.c
parent602bdd1c6ae61f845d135a5c98a90de11e8b06a7 (diff)
parent4300ca623482508d19caf427fdadce86f811e347 (diff)
downloadhdf5-c752332bfd0e9c3090f3a0c02d0253cd45c2e2ce.zip
hdf5-c752332bfd0e9c3090f3a0c02d0253cd45c2e2ce.tar.gz
hdf5-c752332bfd0e9c3090f3a0c02d0253cd45c2e2ce.tar.bz2
Merge branch 'develop' into parallel_vds_develop
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index c93bf32..c420046 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -176,7 +176,12 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
/* Decode and store the name */
if(NULL == (attr->shared->name = H5MM_strdup((const char *)p)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+ /* Make an attempt to detect corrupted name or name length - HDFFV-10588 */
+ if(name_len != (HDstrlen(attr->shared->name) + 1))
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "attribute name has different length than stored length")
+
if(attr->shared->version < H5O_ATTR_VERSION_2)
p += H5O_ALIGN_OLD(name_len); /* advance the memory pointer */
else