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

Fixes a segfault in h5dump #4862

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Fixes a segfault in h5dump #4862

merged 2 commits into from
Sep 23, 2024

Conversation

bmribler
Copy link
Contributor

h5dump produced a segfault on a mal-formed file because a B-tree node level was corrupted.
This PR adds a check to detect when the node level is greater than the number of entries and to issue an error instead.

Fixes GH-4432

The B-tree node level was corrupted, resulting in a segfault later.
This PR adds a check to detect when the node level is greater than
the number of entries and issue an error instead.

Fixes HDFGroupGH-4432
Copy link
Contributor

@qkoziol qkoziol left a comment

Choose a reason for hiding this comment

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

Probably could have a tighter bound, but this is definitely an error. :-)

@lrknox lrknox merged commit ff0839d into HDFGroup:develop Sep 23, 2024
56 checks passed
@bmribler bmribler added Merge - To 1.14 Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - C Library Core C library issues (usually in the src directory) labels Sep 23, 2024
qkoziol pushed a commit to qkoziol/hdf5 that referenced this pull request Oct 1, 2024
* Fixes a segfault in h5dump

The B-tree node level was corrupted, resulting in a segfault later.
This PR adds a check to detect when the node level is greater than
the number of entries and issue an error instead.

Fixes HDFGroupGH-4432
lrknox pushed a commit to lrknox/hdf5 that referenced this pull request Oct 2, 2024
* Fixes a segfault in h5dump

The B-tree node level was corrupted, resulting in a segfault later.
This PR adds a check to detect when the node level is greater than
the number of entries and issue an error instead.

Fixes HDFGroupGH-4432
lrknox pushed a commit that referenced this pull request Oct 2, 2024
* Fixes a segfault in h5dump

The B-tree node level was corrupted, resulting in a segfault later.
This PR adds a check to detect when the node level is greater than
the number of entries and issue an error instead.

Fixes GH-4432
bmribler added a commit to bmribler/hdf5_bmr23 that referenced this pull request Oct 24, 2024
Added another argument, expected node level, to H5B__iterate_helper to pass down
to H5B__cache_deserialize for checking the decoded node level.  When this expected
level is not known, the new macro H5_UNKNOWN_NODELEVEL (-1) will be used for not
checking the level.

Fixes HDFGroupGH-4432
@bmribler bmribler deleted the fix_GH-4432 branch October 30, 2024 18:28
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 - 2. Medium ⏹ It would be nice to have this in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StackOverflow in vasprintf.c
5 participants