aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 85 forks source link

Fix definition of `H5L_info2_t` #261

Closed soph-dec closed 1 year ago

soph-dec commented 1 year ago

Replace incorrect H5L_info1_t__u with H5L_info2_t__u. Since H5L_info1_t__u does not have the same size as H5L_info2_t__u, this bug resulted in 8 bytes of stack memory outside the allocated region being overwritten by the hdf5 C-library for example when using H5Lget_info2.

Since Debug can no longer be derived, add a manual implementation for the struct H5L_info2_t in order to correctly match the variant of H5L_info2_t__u to the link type.

Additionally, add methods to access the union fields of H5L_info2_t__u.

soph-dec commented 1 year ago

I pushed one more commit to fix the clippy error in hdf5-sys. Some of the other tests are still failing, but I do not know how this could be connected to my changes.

mulimoen commented 1 year ago

The clippy and MSRV jobs are known to be failing. On windows we have started to get some random failures, although unrelated to this change

soph-dec commented 1 year ago

I see, thanks for clarifying!