qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 31/62] block: vhdx - add error check


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 31/62] block: vhdx - add error check
Date: Fri, 8 Aug 2014 19:39:32 +0200

From: Jeff Cody <address@hidden>

This add an error check for an invalid descriptor entry signature,
when flushing the log descriptor entries.

Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block/vhdx-log.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index a77c040..7c2630d 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;
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]