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

Add H5Tdecode2, rename and deprecate H5Tdecode #5213

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

mattjala
Copy link
Contributor

@mattjala mattjala commented Jan 7, 2025

When provided malformed or too-small buffers, H5Tdecode() could crash due to walking off the end of the buffer. The new buffer size parameter allows this to be reliably avoided.

Resolves #4661

@mattjala mattjala added Merge - Develop Only This cannot be merged to previous versions of HDF5 (file format or breaking API changes) 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) Type - New Feature Add a new API call, functionality, or tool Branch - 2.0 PRs to the HDF5 2.x maintenance branch labels Jan 7, 2025
@mattjala mattjala added this to the 2.0.0 milestone Jan 7, 2025
release_docs/RELEASE.txt Outdated Show resolved Hide resolved
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.

Looks very good, just needs a test for H5Tdecode1

test/dtypes.c Show resolved Hide resolved
@mattjala mattjala requested a review from qkoziol January 8, 2025 16:27
@derobins derobins added Component - C++ C++ wrappers Component - Testing Code in test or testpar directories, GitHub workflows labels Jan 13, 2025
bmribler
bmribler previously approved these changes Jan 13, 2025
src/H5T.c Outdated Show resolved Hide resolved
test/dtypes.c Outdated Show resolved Hide resolved
@mattjala mattjala dismissed stale reviews from bmribler and qkoziol via 96e5e14 January 14, 2025 16:52
jhendersonHDF
jhendersonHDF previously approved these changes Jan 14, 2025
qkoziol
qkoziol previously approved these changes Jan 14, 2025
fortran/src/H5Tff.F90 Outdated Show resolved Hide resolved
fortran/test/tH5T.F90 Outdated Show resolved Hide resolved
Copy link
Collaborator

@brtnfld brtnfld left a comment

Choose a reason for hiding this comment

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

Address Fortran issues.

src/H5vers.txt Outdated
@@ -86,6 +86,7 @@ FUNCTION: H5Tarray_create; ; v14, v18
FUNCTION: H5Tcommit; ; v10, v18
FUNCTION: H5Tget_array_dims; ; v14, v18
FUNCTION: H5Topen; ; v10, v18
FUNCTION: H5Tdecode; ; v12, v200
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find H5Tdecode in the code tag hdf5-1_8_0, but not in tag hdf5-1_6_10, so I think this line should end with ; v18, v200.

I believe that change would also not add lines 151 - 154 in H5version.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's strange. I can't find it in 1.6 either, but the reference manual lists it as since 1.2. I'll update both of these to reflect a 1.8 addition.

@mattjala mattjala dismissed stale reviews from qkoziol and jhendersonHDF via 10c1cf4 January 15, 2025 19:23
@mattjala mattjala requested review from lrknox and brtnfld January 15, 2025 19:23
lrknox
lrknox previously approved these changes Jan 15, 2025
Make buf_size an optional a parameter
Make buf_size optional
test optional parameter
Copy link
Collaborator

@brtnfld brtnfld left a comment

Choose a reason for hiding this comment

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

I made the Fortran API use an optional parameter instead since it is not all that needed from a Fortran perspective.

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) Component - C++ C++ wrappers Component - Fortran Fortran wrappers Component - Java Java wrappers Component - Testing Code in test or testpar directories, GitHub workflows Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - New Feature Add a new API call, functionality, or tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

H5Tdecode should require buffer size parameter
7 participants