Repository navigation
Conversation
The returned value from H5I_get_type() is not checked in many functions in this kind of statement. This can potentially cause issues further down if one of those H5I_get_type() fails. Fixes HDFGroupGH-4764
bmribler
requested review from
fortnern,
glennsong09,
jhendersonHDF,
mattjala and
vchoi-hdfgroup
as code owners
October 19, 2026 05:01
github-actions
Bot
removed request for
glennsong09,
jhendersonHDF,
mattjala and
vchoi-hdfgroup
October 19, 2026 05:01
Contributor
Review ChecklistThis PR touches the following areas. Each needs a sign-off
|
fortnern
reviewed
Oct 23, 2026
| if (H5I_ATTR == H5I_get_type(loc_id)) | ||
| if (H5I_BADID == (vol_obj_type = H5I_get_type(loc_id))) | ||
| HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier"); | ||
| if (H5I_ATTR == vol_obj_type) |
Member
There was a problem hiding this comment.
It seems to me this still isn't a very good check. It should check the ID against a list of valid classes, not a list of invalid classes. Looking at the enum definition it looks like most values don't have a valid location. I would suggest creating a macro for checking if an ID type has a valid location. I believe you could just check if (type >= H5I_FILE) && (type <= H5I_MAP)
Member
There was a problem hiding this comment.
I'm also not convinced the temporary variables are necessary
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The returned value from H5I_get_type() is not checked in many functions in this kind of statement. This can potentially cause issues further down if one of those H5I_get_type() fails.
Fixes GH-4764
(replaces PR #6711 dues to issues with clang-format)