Skip to content

ColTypeDim et al.: Fix Potential Segfault #285

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Apr 8, 2021

From the docs:

Name: H5Tget_member_name
  ...
  The HDF5 Library allocates a buffer to receive the name of the
  field. The caller must subsequently free the buffer with
  H5free_memory.

Also: passing NULL to str(n)cmp is undefined behavior.

Refs.:

From the docs:
```
Name: H5Tget_member_name
  ...
  The HDF5 Library allocates a buffer to receive the name of the
  field. The caller must subsequently free the buffer with
  H5free_memory.
```
Refs.:
- https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetMemberName
- https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-FreeMemory
@ax3l ax3l changed the title ColTypeDim: Fix Potential Segfault ColTypeDim et al.: Fix Potential Segfault Apr 8, 2021
Passing potential `NULL` is undefined behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant