From a7be17bee855f26c317e99aa6582e1dc9b8ebd71 Mon Sep 17 00:00:00 2001 From: Jeff Cody Date: Tue, 10 Feb 2015 13:22:56 -0500 Subject: [PATCH] block: vmdk - fixed sizeof() error 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 --- block/vmdk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 7d079adc4a..8410a158a2 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -843,8 +843,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_open(&extent_file, extent_path, NULL, NULL, bs->open_flags | BDRV_O_PROTOCOL, NULL, errp); -- 2.11.4.GIT