qcow: add a safety comment

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2022-11-16 21:42:29 +00:00 committed by Liu Wei
parent c4ffdad4bc
commit ca02a69fdf

View File

@ -231,6 +231,7 @@ impl Write for RawFile {
return Err(io::Error::last_os_error());
}
// SAFETY: tmp_ptr is at least rounded_len long
let tmp_buf = unsafe { slice::from_raw_parts_mut(tmp_ptr, rounded_len) };
// This can eventually replaced with read_at once its interface