clippy: fix access to unaligned buffer in dynamic reader
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
b526bd1408
commit
ba5e67475a
|
@ -80,9 +80,7 @@ impl DynamicIndexReader {
|
||||||
|
|
||||||
let header_size = std::mem::size_of::<DynamicIndexHeader>();
|
let header_size = std::mem::size_of::<DynamicIndexHeader>();
|
||||||
|
|
||||||
let buffer = file.read_exact_allocated(header_size)?;
|
let header: Box<DynamicIndexHeader> = unsafe { file.read_host_value_boxed()? };
|
||||||
|
|
||||||
let header = unsafe { &* (buffer.as_ptr() as *const DynamicIndexHeader) };
|
|
||||||
|
|
||||||
if header.magic != super::DYNAMIC_SIZED_CHUNK_INDEX_1_0 {
|
if header.magic != super::DYNAMIC_SIZED_CHUNK_INDEX_1_0 {
|
||||||
bail!("got unknown magic number");
|
bail!("got unknown magic number");
|
||||||
|
|
Loading…
Reference in New Issue