nicholasbishop / ext4-view-rs

Rust library for reading ext2/ext4 filesystems
https://crates.io/crates/ext4-view
Apache License 2.0
8 stars 2 forks source link

dir_entry: Add guard for too-small record length #80

Closed nicholasbishop closed 4 months ago

nicholasbishop commented 4 months ago

The length should always be at least 8 bytes, otherwise there wouldn't be enough space for the header fields. And a record length of zero would cause an infinite loop when reading entries. Return an error if the record length doesn't make sense to guard against bugs and malicious filesystems.