]> Git Repo - qemu.git/commitdiff
block: vhdx - add error check
authorJeff Cody <[email protected]>
Wed, 6 Aug 2014 19:54:57 +0000 (15:54 -0400)
committerKevin Wolf <[email protected]>
Fri, 15 Aug 2014 13:07:14 +0000 (15:07 +0200)
This add an error check for an invalid descriptor entry signature,
when flushing the log descriptor entries.

Signed-off-by: Jeff Cody <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/vhdx-log.c

index a77c040ee02c19374e145dd36df510757526875c..7c2630d659da1d6c6824bfcdc26683c55bf04307 100644 (file)
@@ -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;
This page took 0.027277 seconds and 4 git commands to generate.