From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhiAD-0001F9-BC for qemu-devel@nongnu.org; Wed, 17 Feb 2010 06:33:53 -0500 Received: from [199.232.76.173] (port=36336 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhiAB-0001F1-RH for qemu-devel@nongnu.org; Wed, 17 Feb 2010 06:33:51 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NhiAA-0002FZ-Ej for qemu-devel@nongnu.org; Wed, 17 Feb 2010 06:33:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25401) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NhiAA-0002F8-20 for qemu-devel@nongnu.org; Wed, 17 Feb 2010 06:33:50 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1HBXl17015825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Feb 2010 06:33:48 -0500 From: Kevin Wolf Date: Wed, 17 Feb 2010 12:32:59 +0100 Message-Id: <1266406379-5029-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] qemu-img: Fix segfault during rebase List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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 --- 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); -- 1.6.6