mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
block: vhdx - add error check
This add an error check for an invalid descriptor entry signature, when flushing the log descriptor entries. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
3c80ca158c
commit
349592e0b9
1 changed files with 5 additions and 0 deletions
|
@ -435,6 +435,11 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc,
|
|||
/* write 'count' sectors of sector */
|
||||
memset(buffer, 0, VHDX_LOG_SECTOR_SIZE);
|
||||
count = desc->zero_length / VHDX_LOG_SECTOR_SIZE;
|
||||
} else {
|
||||
error_report("Invalid VHDX log descriptor entry signature 0x%" PRIx32,
|
||||
desc->signature);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
file_offset = desc->file_offset;
|
||||
|
|
Loading…
Reference in a new issue