You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In From implementation above, we can cast from [u8, BSIZE] to [u32; NENTRY]. In addition to checking size and alignment, the results of casting around bytes between data types are endian dependent, and I couldn't find any specification about byte-order here. What's more, the u32 byte slice is mutable, which means we can change the u32 byte slice value and affect the u8 byte slice by different order again.
Maybe using byteorder could help solving this kind of issues.
rv6/kernel-rs/src/fs/lfs/imap.rs
Lines 32 to 38 in f55cf81
In
From
implementation above, we can cast from[u8, BSIZE]
to[u32; NENTRY]
. In addition to checking size and alignment, the results of casting around bytes between data types are endian dependent, and I couldn't find any specification about byte-order here. What's more, the u32 byte slice is mutable, which means we can change the u32 byte slice value and affect the u8 byte slice by different order again.Maybe using byteorder could help solving this kind of issues.
Please correct me if I mistake for something;)
reference: https://docs.rs/bytemuck/latest/bytemuck/trait.Pod.html
The text was updated successfully, but these errors were encountered: