Closed LunNova closed 1 year ago
Curse of me starting this crate when I was new to Rust, literally like confusing const char *
and std::string
. Thanks for reporting this, I'll get this fixed in the next version!
This actually made me realize there's a bug here, so this might take a little longer to come out-- there's a possibility that a section name can not be a valid UTF8 string, and so the str
returned by as_str()
would cause a panic when the string is used because it's not valid UTF8. This happens because I'm intentionally transmuting a reference that points into the PE file.
Anyway, I've started work on this, I'll update you when I get this bug fixed!
Okay, this issue plus the issue this uncovered have been fixed as of this commit: https://github.com/frank2/exe-rs/commit/02527d94fad138839aa28740862b32088893ee3c. This will be officially released in 0.5.5. Thanks again for reporting!
This is live in 0.5.6 (not 0.5.5, no idea what release that was). Thanks again!
Taking an &str would be nicer here and it looks like it's fine since it immediately gets converted to one.