From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Niauq-0003Be-8i for qemu-devel@nongnu.org; Fri, 19 Feb 2010 17:01:40 -0500 Received: from [199.232.76.173] (port=48983 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Niaup-0003BA-JF for qemu-devel@nongnu.org; Fri, 19 Feb 2010 17:01:39 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Niauo-0002CW-1n for qemu-devel@nongnu.org; Fri, 19 Feb 2010 17:01:39 -0500 Received: from mail-yx0-f200.google.com ([209.85.210.200]:56619) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Niaun-0002CQ-OV for qemu-devel@nongnu.org; Fri, 19 Feb 2010 17:01:37 -0500 Received: by yxe38 with SMTP id 38so521972yxe.4 for ; Fri, 19 Feb 2010 14:01:37 -0800 (PST) Message-ID: <4B7F0A3D.6040908@codemonkey.ws> Date: Fri, 19 Feb 2010 16:01:33 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qemu-img: Fix segfault during rebase References: <1266406379-5029-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1266406379-5029-1-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On 02/17/2010 05:32 AM, Kevin Wolf wrote: > This fixes a possible read beyond the end of the temporary buffers used for > comparing data in the old and the new backing file. > > Signed-off-by: Kevin Wolf > Applied. Thanks. Regards, Anthony Liguori > --- > qemu-img.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/qemu-img.c b/qemu-img.c > index 250d892..258dc62 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -1225,7 +1225,7 @@ static int img_rebase(int argc, char **argv) > int pnum; > > if (compare_sectors(buf_old + written * 512, > - buf_new + written * 512, n,&pnum)) > + buf_new + written * 512, n - written,&pnum)) > { > ret = bdrv_write(bs, sector + written, > buf_old + written * 512, pnum); >