mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-07-03 14:05:11 +02:00
Merge pull request #232 from chenxiaolong/small_hash_tree
avb: hashtree: Fix incorrect I/O read size for input smaller than one block
This commit is contained in:
@@ -475,7 +475,7 @@ impl HashTreeDescriptor {
|
||||
// Small files are hashed directly, exactly like a hash descriptor.
|
||||
if image_size <= u64::from(block_size) {
|
||||
let mut reader = input.reopen_boxed()?;
|
||||
let mut buf = vec![0u8; block_size as usize];
|
||||
let mut buf = vec![0u8; image_size as usize];
|
||||
reader.read_exact(&mut buf)?;
|
||||
|
||||
let mut context = Context::new(algorithm);
|
||||
|
||||
Reference in New Issue
Block a user