Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with empty or uninitialized link names #4322

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

jhendersonHDF
Copy link
Collaborator

Converts an assertion in H5G_loc_find into a normal error check that checks for empty link names

Initializes H5O_link_t structure early in H5G__ent_to_link to avoid trying to free potentially uninitialized memory

Checks for an empty link name after H5MM_strndup in H5G__ent_to_link

Fixes GitHub #4307

Converts an assertion in H5G_loc_find into a normal error
check that checks for empty link names

Initializes H5O_link_t structure early in H5G__ent_to_link
to avoid trying to free potentially uninitialized memory

Checks for an empty link name after H5MM_strndup in
H5G__ent_to_link

Fixes GitHub HDFGroup#4307
@jhendersonHDF jhendersonHDF added Merge - To 1.14 Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Component - C Library Core C library issues (usually in the src directory) Type - Bug / Bugfix Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub labels Apr 4, 2024
@jhendersonHDF jhendersonHDF linked an issue Apr 4, 2024 that may be closed by this pull request
@@ -410,9 +410,12 @@ H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc /*out*/)

/* Check args. */
assert(loc);
assert(name && *name);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing in debug builds due to the assertion on *name, but would pass for release/production builds. That said, I don't think it's allowed to have an empty link name for an object, so I converted this to a regular error check.

@jhendersonHDF
Copy link
Collaborator Author

This fixes the current CVE testing. It doesn't appear to be a missed issue, but rather a new issue that was masked by previous CVE problems.

@lrknox lrknox merged commit 3424bc9 into HDFGroup:develop Apr 4, 2024
58 checks passed
lrknox pushed a commit to lrknox/hdf5 that referenced this pull request Apr 4, 2024
Converts an assertion in H5G_loc_find into a normal error
check that checks for empty link names

Initializes H5O_link_t structure early in H5G__ent_to_link
to avoid trying to free potentially uninitialized memory

Checks for an empty link name after H5MM_strndup in
H5G__ent_to_link

Fixes GitHub HDFGroup#4307
lrknox added a commit that referenced this pull request Apr 4, 2024
* Remove VS ptable error from Known Problems (#4317)

* Simply check for datatypes with unusual number of unused bits (#4309)

Avoids potential undefined behavior in H5T_is_numeric_with_unusual_unused_bits

* Fix issues with empty or uninitialized link names (#4322)

Converts an assertion in H5G_loc_find into a normal error
check that checks for empty link names

Initializes H5O_link_t structure early in H5G__ent_to_link
to avoid trying to free potentially uninitialized memory

Checks for an empty link name after H5MM_strndup in
H5G__ent_to_link

Fixes GitHub #4307

* Fix h5py testing failure due to invalid datatype IDs (#4321)

Fixes an issue where invalid datatype IDs are passed to application conversion
functions in the case where the top-level conversion function is a library-internal
function that operates on a container-like datatype, but one or more of the
base datatype members are converted with an application conversion function.

* Revise _Float16 configure checks (#4323)

Run configure checks with and without CFLAGS/CMAKE_C_FLAGS since some
compilers work in one case while not working in the other case

Sync CMake configure checks with Autotools
lrknox added a commit to lrknox/hdf5 that referenced this pull request Apr 4, 2024
* Remove VS ptable error from Known Problems (HDFGroup#4317)

* Simply check for datatypes with unusual number of unused bits (HDFGroup#4309)

Avoids potential undefined behavior in H5T_is_numeric_with_unusual_unused_bits

* Fix issues with empty or uninitialized link names (HDFGroup#4322)

Converts an assertion in H5G_loc_find into a normal error
check that checks for empty link names

Initializes H5O_link_t structure early in H5G__ent_to_link
to avoid trying to free potentially uninitialized memory

Checks for an empty link name after H5MM_strndup in
H5G__ent_to_link

Fixes GitHub HDFGroup#4307

* Fix h5py testing failure due to invalid datatype IDs (HDFGroup#4321)

Fixes an issue where invalid datatype IDs are passed to application conversion
functions in the case where the top-level conversion function is a library-internal
function that operates on a container-like datatype, but one or more of the
base datatype members are converted with an application conversion function.

* Revise _Float16 configure checks (HDFGroup#4323)

Run configure checks with and without CFLAGS/CMAKE_C_FLAGS since some
compilers work in one case while not working in the other case

Sync CMake configure checks with Autotools
@jhendersonHDF jhendersonHDF deleted the cve_test_fix branch April 4, 2024 17:46
qkoziol pushed a commit to qkoziol/hdf5 that referenced this pull request Apr 8, 2024
Converts an assertion in H5G_loc_find into a normal error
check that checks for empty link names

Initializes H5O_link_t structure early in H5G__ent_to_link
to avoid trying to free potentially uninitialized memory

Checks for an empty link name after H5MM_strndup in
H5G__ent_to_link

Fixes GitHub HDFGroup#4307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Type - Bug / Bugfix Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Projects
Status: Needs Merged
Development

Successfully merging this pull request may close these issues.

use-of-uninitialized-value error in H5G__ent_to_link
3 participants