Blame SOURCES/kvm-dmg-use-appropriate-types-when-reading-chunks.patch

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