HarfangLab / endpoint-sec

Rust Bindings for Endpoint Security
https://docs.rs/endpoint-sec/
Apache License 2.0
21 stars 5 forks source link

Fix segfault when using default feature #34

Closed roblabla closed 10 months ago

roblabla commented 10 months ago

When using the default feature, the FFI structure for es_message_t was wrong (a field in the middle was cfg'd out, causing everything to be offset by 8 bytes).

To fix this issue, we simply remove the wrong cfg, fixing the es_message_t structure.

Fixes #33

I did a quick review of the other structures, but they seem to be OK, all the cfgs are at the end, and always ordered from oldest to newest.

Note that I did not change the seq_num() accessor, which is cfg'd to be accessible only on macos_10_15_4+. I think that's correct enough.

radiohertz commented 10 months ago

Just tested it, seems to be fixed!