qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/4] vmdk: check for negative sector nums also


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 1/4] vmdk: check for negative sector nums also
Date: Thu, 19 Feb 2009 18:19:33 -0300

Signed-off-by: Eduardo Habkost <address@hidden>
---
 block-vmdk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block-vmdk.c b/block-vmdk.c
index 71d7504..416fb95 100644
--- a/block-vmdk.c
+++ b/block-vmdk.c
@@ -649,7 +649,7 @@ static int vmdk_write(BlockDriverState *bs, int64_t 
sector_num,
     uint64_t cluster_offset;
     static int cid_update = 0;
 
-    if (sector_num > bs->total_sectors) {
+    if (sector_num < 0 || sector_num > bs->total_sectors) {
         fprintf(stderr,
                 "(VMDK) Wrong offset: sector_num=0x%" PRIx64
                 " total_sectors=0x%" PRIx64 "\n",
-- 
1.6.1





reply via email to

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