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