Skip to content

ColTypeDim et al.: Fix Potential Segfault#285

Open
ax3l wants to merge 3 commits intoComputationalRadiationPhysics:devfrom
ax3l:fix-ColTypeDimFree
Open

ColTypeDim et al.: Fix Potential Segfault#285
ax3l wants to merge 3 commits intoComputationalRadiationPhysics:devfrom
ax3l:fix-ColTypeDimFree

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