Blame 0207-vmdk-vmdk_read_cid-returns-garbage-if-p_name-is-NULL.patch

cd9d16
From 1b09be835d853b8fd591e1f5de29ae20ed405722 Mon Sep 17 00:00:00 2001
cd9d16
From: Pavel Borzenkov <pavel.borzenkov@gmail.com>
cd9d16
Date: Tue, 18 Oct 2011 21:19:03 +0400
cd9d16
Subject: [PATCH] vmdk: vmdk_read_cid returns garbage if p_name is NULL
cd9d16
MIME-Version: 1.0
cd9d16
Content-Type: text/plain; charset=UTF-8
cd9d16
Content-Transfer-Encoding: 8bit
cd9d16
cd9d16
Spotted by Clang Analyzer
cd9d16
cd9d16
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
cd9d16
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
cd9d16
(cherry picked from commit 8379e46d1fd681b8aa4714382e2cdab05e5d0575)
cd9d16
cd9d16
Signed-off-by: Bruce Rogers <brogers@suse.com>
cd9d16
Signed-off-by: Andreas Färber <afaerber@suse.de>
cd9d16
---
cd9d16
 block/vmdk.c | 2 +-
cd9d16
 1 file changed, 1 insertion(+), 1 deletion(-)
cd9d16
cd9d16
diff --git a/block/vmdk.c b/block/vmdk.c
cd9d16
index 37478d2..b5caa40 100644
cd9d16
--- a/block/vmdk.c
cd9d16
+++ b/block/vmdk.c
cd9d16
@@ -177,7 +177,7 @@ static void vmdk_free_extents(BlockDriverState *bs)
cd9d16
 static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent)
cd9d16
 {
cd9d16
     char desc[DESC_SIZE];
cd9d16
-    uint32_t cid;
cd9d16
+    uint32_t cid = 0xffffffff;
cd9d16
     const char *p_name, *cid_str;
cd9d16
     size_t cid_str_size;
cd9d16
     BDRVVmdkState *s = bs->opaque;
cd9d16
-- 
cd9d16
1.7.11.2
cd9d16