From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLIZb-0003Io-In for qemu-devel@nongnu.org; Tue, 10 Feb 2015 16:42:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLIZW-0003Zg-KS for qemu-devel@nongnu.org; Tue, 10 Feb 2015 16:42:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLIZW-0003ZW-Dm for qemu-devel@nongnu.org; Tue, 10 Feb 2015 16:42:18 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1ALgHZV006592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 10 Feb 2015 16:42:17 -0500 Message-ID: <54DA7B36.90801@redhat.com> Date: Tue, 10 Feb 2015 16:42:14 -0500 From: Max Reitz MIME-Version: 1.0 References: <46d873261433f4527e88885582f96942d61758d6.1423592487.git.jcody@redhat.com> In-Reply-To: <46d873261433f4527e88885582f96942d61758d6.1423592487.git.jcody@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, famz@redhat.com, stefanha@redhat.com On 2015-02-10 at 13:22, Jeff Cody wrote: > The size compared should be PATH_MAX, rather than sizeof(char *). > > Reported-by: Paolo Bonzini > Signed-off-by: Jeff Cody > --- > block/vmdk.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) I just noticed iotest 059 failing, bisected it and the changeset of the commit in question looked strangely related to a patch I seemed to recall having seen on qemu-devel today... :-) Reviewed-by: Max Reitz > diff --git a/block/vmdk.c b/block/vmdk.c > index 7d079ad..8410a15 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);