aboutsummaryrefslogtreecommitdiff
path: root/block/vhdx-log.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2014-08-06 15:54:57 -0400
committerKevin Wolf <kwolf@redhat.com>2014-08-15 15:07:14 +0200
commit349592e0b9112171500e940dd921bb96cfc496d2 (patch)
treefc521a4cc799741538614d28e11972f12f030d2e /block/vhdx-log.c
parent3c80ca158c96ff902a30883a8933e755988948b1 (diff)
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>
Diffstat (limited to 'block/vhdx-log.c')
-rw-r--r--block/vhdx-log.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index a77c040ee0..7c2630d659 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -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;