|
|
9ae3a8 |
From 6be48dc02a2906f7b88dc5b2751f19b530ec0f58 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Date: Tue, 25 Mar 2014 14:23:43 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 36/49] dmg: use appropriate types when reading chunks
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1395753835-7591-37-git-send-email-kwolf@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: n/a
|
|
|
9ae3a8 |
O-Subject: [virt-devel] [EMBARGOED RHEL-7.0 qemu-kvm PATCH 36/48] dmg: use appropriate types when reading chunks
|
|
|
9ae3a8 |
Bugzilla: 1066691
|
|
|
9ae3a8 |
RH-Acked-by: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1066691
|
|
|
9ae3a8 |
Upstream status: Series embargoed
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Use the right types instead of signed int:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
size_t new_size;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
This is a byte count for g_realloc() that is calculated from uint32_t
|
|
|
9ae3a8 |
and size_t values.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
uint32_t chunk_count;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Use the same type as s->n_chunks, which is used together with
|
|
|
9ae3a8 |
chunk_count.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
This patch is a cleanup and does not fix bugs.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/dmg.c | 3 ++-
|
|
|
9ae3a8 |
1 files changed, 2 insertions(+), 1 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/dmg.c b/block/dmg.c
|
|
|
9ae3a8 |
index 1cc5426..f98c94d 100644
|
|
|
9ae3a8 |
--- a/block/dmg.c
|
|
|
9ae3a8 |
+++ b/block/dmg.c
|
|
|
9ae3a8 |
@@ -161,7 +161,8 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (type == 0x6d697368 && count >= 244) {
|
|
|
9ae3a8 |
- int new_size, chunk_count;
|
|
|
9ae3a8 |
+ size_t new_size;
|
|
|
9ae3a8 |
+ uint32_t chunk_count;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
offset += 4;
|
|
|
9ae3a8 |
offset += 200;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|