m4b / goblin

An impish, cross-platform binary parsing crate, written in Rust
MIT License
1.19k stars 158 forks source link

Safety invariants for GnuHash::from_raw_table should be documented #215

Open leo60228 opened 4 years ago

leo60228 commented 4 years ago

I can't tell what I need to do to use this safely. https://docs.rs/goblin/0.2.1/goblin/elf64/gnu_hash/struct.GnuHash.html

philipc commented 4 years ago

I'm not sure if this function even needs to be unsafe anymore. Ideally it wouldn't be. There is some discussion at https://github.com/m4b/goblin/pull/151#discussion_r362302668. The point of that discussion was that we need to either keep it unsafe or add checks for the safety conditions, and it seems we did both. Someone should audit it though.