]> Git Repo - qemu.git/commitdiff
Fix 32-bit overflow in parallels image support
authorDavid Woodhouse <[email protected]>
Sat, 7 Nov 2009 14:10:01 +0000 (14:10 +0000)
committerAnthony Liguori <[email protected]>
Thu, 12 Nov 2009 17:23:56 +0000 (11:23 -0600)
Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
block/parallels.c

index 0b64a5c62568eb62bf0c6221787bc79292c3d99c..63b67380ad8b80a7fc7665bc209e0d651cff27f8 100644 (file)
@@ -119,7 +119,8 @@ fail:
 static inline int seek_to_sector(BlockDriverState *bs, int64_t sector_num)
 {
     BDRVParallelsState *s = bs->opaque;
-    uint32_t index, offset, position;
+    uint32_t index, offset;
+    uint64_t position;
 
     index = sector_num / s->tracks;
     offset = sector_num % s->tracks;
@@ -128,7 +129,7 @@ static inline int seek_to_sector(BlockDriverState *bs, int64_t sector_num)
     if ((index > s->catalog_size) || (s->catalog_bitmap[index] == 0))
        return -1;
 
-    position = (s->catalog_bitmap[index] + offset) * 512;
+    position = (uint64_t)(s->catalog_bitmap[index] + offset) * 512;
 
 //    fprintf(stderr, "sector: %llx index=%x offset=%x pointer=%x position=%x\n",
 //     sector_num, index, offset, s->catalog_bitmap[index], position);
This page took 0.028352 seconds and 4 git commands to generate.