34b321
From 37bf9db781d9507501649ee04d23b0dab103a126 Mon Sep 17 00:00:00 2001
34b321
From: Fam Zheng <famz@redhat.com>
34b321
Date: Mon, 15 Feb 2016 09:28:23 +0100
34b321
Subject: [PATCH 10/18] block: vmdk - fixed sizeof() error
34b321
34b321
RH-Author: Fam Zheng <famz@redhat.com>
34b321
Message-id: <1455528511-9357-11-git-send-email-famz@redhat.com>
34b321
Patchwork-id: 69176
34b321
O-Subject: [RHEL-7.3 qemu-kvm PATCH 10/18] block: vmdk - fixed sizeof() error
34b321
Bugzilla: 1299250
34b321
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
34b321
RH-Acked-by: Max Reitz <mreitz@redhat.com>
34b321
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
34b321
34b321
From: Jeff Cody <jcody@redhat.com>
34b321
34b321
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1299250
34b321
34b321
The size compared should be PATH_MAX, rather than sizeof(char *).
34b321
34b321
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
34b321
Signed-off-by: Jeff Cody <jcody@redhat.com>
34b321
Reviewed-by: Eric Blake <eblake@redhat.com>
34b321
Reviewed-by: Max Reitz <mreitz@redhat.com>
34b321
Message-id: 46d873261433f4527e88885582f96942d61758d6.1423592487.git.jcody@redhat.com
34b321
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
34b321
(cherry picked from commit a7be17bee855f26c317e99aa6582e1dc9b8ebd71)
34b321
Signed-off-by: Fam Zheng <famz@redhat.com>
34b321
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
34b321
---
34b321
 block/vmdk.c | 3 +--
34b321
 1 file changed, 1 insertion(+), 2 deletions(-)
34b321
34b321
diff --git a/block/vmdk.c b/block/vmdk.c
34b321
index 45ecf02..32b3d4c 100644
34b321
--- a/block/vmdk.c
34b321
+++ b/block/vmdk.c
34b321
@@ -838,8 +838,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
34b321
         }
34b321
 
34b321
         extent_path = g_malloc0(PATH_MAX);
34b321
-        path_combine(extent_path, sizeof(extent_path),
34b321
-                desc_file_path, fname);
34b321
+        path_combine(extent_path, PATH_MAX, desc_file_path, fname);
34b321
         extent_file = NULL;
34b321
         ret = bdrv_file_open(&extent_file, extent_path, NULL, bs->open_flags,
34b321
                              errp);
34b321
-- 
34b321
1.8.3.1
34b321