libSplash icon indicating copy to clipboard operation
libSplash copied to clipboard

ColTypeDim et al.: Fix Potential Segfault

Open ax3l opened this issue 4 years ago • 0 comments

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.:

  • https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetMemberName
  • https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-FreeMemory
  • 2da14a60f2244881829d95987ac6f90cfd34a33b
  • https://github.com/openPMD/openPMD-api/pull/962

ax3l avatar Apr 08 '21 20:04 ax3l