Skip to content

Commit

Permalink
Add missed protection around user callback
Browse files Browse the repository at this point in the history
Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Dec 4, 2024
1 parent b209735 commit 594c12d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/H5Iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,12 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
object = H5I__unwrap(info->u.object, type);

/* Invoke callback function */
cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata);
/* Prepare & restore library for user callback */
H5_BEFORE_USER_CB_NOERR(H5_ITER_ERROR)
{
cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata);
}
H5_AFTER_USER_CB_NOERR(NULL)

/* Set the return value based on the callback's return value */
if (cb_ret_val > 0)
Expand Down

0 comments on commit 594c12d

Please sign in to comment.