diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2017-08-24 19:37:13 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2017-08-24 19:37:13 (GMT) |
commit | e04817b5aa097f7e98e3552c854d7d0a05708f3e (patch) | |
tree | d8f485854202a89b7bf0ff9d49ae5f7c8fec6870 /src/H5Gstab.c | |
parent | 1cf7c7ecc90b408fed818b00153a2d36295da801 (diff) | |
parent | 593e4038b3ab474a47e468bb3478d4ae3a6820e6 (diff) | |
download | hdf5-e04817b5aa097f7e98e3552c854d7d0a05708f3e.zip hdf5-e04817b5aa097f7e98e3552c854d7d0a05708f3e.tar.gz hdf5-e04817b5aa097f7e98e3552c854d7d0a05708f3e.tar.bz2 |
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit '593e4038b3ab474a47e468bb3478d4ae3a6820e6':
Fix for daily test failure Fix for the compilation error from the PGI compiler.
Modifications based on comments from pull request review (1) Remove unnecessary asserts (2) Add code to insert bad offset values to the test file in gen_bad_offset.c
HDFFV-10188 force non-native type description
HDFFV-10188 emu insists on printing non-native description
Fix for HDFFV-10216 segfault in H5G_node_cmp3 with corrupt h5 file Fix H5HL_offset_into() to return error when offset exceeds heap data block size. Also fix other places that call this routine to detect error return.
HDFFV-10188 fix typo
HDFFV-10188 add missing copy commands
HDFFV-10188 Add tests and files
HDFFV-10188 enable null space test
HDFFV-10188 add release note
HDFFV-10188 - Check for empty string first
HDFFV-10188 error on NULL dataspace
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r-- | src/H5Gstab.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c index a239cfe..4dc06ca 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -707,11 +707,12 @@ done: static herr_t H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) { - H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; + H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; size_t name_off; /* Offset of name in heap */ const char *name; /* Pointer to name string in heap */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(ent); @@ -719,12 +720,15 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Get name offset in heap */ name_off = ent->name_off; - name = (const char *)H5HL_offset_into(udata->heap, name_off); - HDassert(name); - udata->name = H5MM_strdup(name); - HDassert(udata->name); - FUNC_LEAVE_NOAPI(SUCCEED) + if((name = (const char *)H5HL_offset_into(udata->heap, name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") + + if((udata->name = H5MM_strdup(name)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to duplicate symbol table link name") + +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_stab_get_name_by_idx_cb */ @@ -941,8 +945,8 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) HDassert(udata && udata->heap); /* Get a pointer to the link name */ - name = (const char *)H5HL_offset_into(udata->heap, ent->name_off); - HDassert(name); + if((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") /* Convert the entry to a link */ if(H5G__ent_to_link(udata->lnk, udata->heap, ent, name) < 0) |