From ba5e67475a9ff7f82c72fe3014171a4597c1d680 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 11 Sep 2019 14:50:45 +0200 Subject: [PATCH] clippy: fix access to unaligned buffer in dynamic reader Signed-off-by: Wolfgang Bumiller --- src/backup/dynamic_index.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/backup/dynamic_index.rs b/src/backup/dynamic_index.rs index d4cb6eb6..49db2da9 100644 --- a/src/backup/dynamic_index.rs +++ b/src/backup/dynamic_index.rs @@ -80,9 +80,7 @@ impl DynamicIndexReader { let header_size = std::mem::size_of::(); - let buffer = file.read_exact_allocated(header_size)?; - - let header = unsafe { &* (buffer.as_ptr() as *const DynamicIndexHeader) }; + let header: Box = unsafe { file.read_host_value_boxed()? }; if header.magic != super::DYNAMIC_SIZED_CHUNK_INDEX_1_0 { bail!("got unknown magic number");