Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/H5Oattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u
*/
if (H5_IS_BUFFER_OVERFLOW(p, name_len, p_end))
HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding");

/* Verify that retrieved name length (including null byte) is valid */
if (name_len <= 1)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "decoded name length is invalid");

if (NULL == (attr->shared->name = H5MM_strndup((const char *)p, name_len - 1)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");

Expand Down
Loading