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

Drop the size check from BlockGroupDescriptor::from_bytes #242

Closed nicholasbishop closed 1 month ago

nicholasbishop commented 1 month ago

This check doesn't work for non-64bit filesystems, where the descriptor is only 32 bytes.

Checking the length also just isn't necessary: read_bytes is a private method that is only called from BlockGroupDescriptor::read, and the byte slice argument is always Superblock::sb.block_group_descriptor_size in length.