block: vhdx: use checked_add in read and write functions
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
463c9b8e56
commit
bc4a1fd16c
1 changed files with 2 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ impl Read for Vhdx {
|
|||
)
|
||||
})?;
|
||||
|
||||
self.current_offset += result as u64;
|
||||
self.current_offset = self.current_offset.checked_add(result as u64).unwrap();
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ impl Write for Vhdx {
|
|||
)
|
||||
})?;
|
||||
|
||||
self.current_offset += result as u64;
|
||||
self.current_offset = self.current_offset.checked_add(result as u64).unwrap();
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue