mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: qcow: Test rejection when backing file overlaps header
Cover the case where backing_file_offset points inside the fixed header fields, which the new header overlap check must reject. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
9c85aab85d
commit
05cac5657c
@@ -2747,6 +2747,12 @@ mod unit_tests {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn backing_file_offset_inside_header() {
|
||||
let err = read_header_with_patched_backing(64, 16).unwrap_err();
|
||||
assert!(matches!(err, Error::BackingFileOverlapsHeader(_, _, _)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn backing_file_fits_at_cluster_end() {
|
||||
let cluster_size = 1u64 << DEFAULT_CLUSTER_BITS;
|
||||
|
||||
Reference in New Issue
Block a user