From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9gr-0001jg-8d for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv9gl-0005TO-Vu for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9gl-0005TI-Np for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:39 -0500 From: Stefan Hajnoczi Date: Tue, 15 Jan 2013 17:48:17 +0100 Message-Id: <1358268511-27061-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1358268511-27061-1-git-send-email-stefanha@redhat.com> References: <1358268511-27061-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 01/15] qcow2: Fix segfault on zero-length write List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi From: Kevin Wolf One of the recent refactoring patches (commit f50f88b9) didn't take care to initialise l2meta properly, so with zero-length writes, which don't even enter the write loop, qemu just segfaulted. Signed-off-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index d603f98..f6abff6 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -759,7 +759,7 @@ static coroutine_fn int qcow2_co_writev(BlockDriverState *bs, QEMUIOVector hd_qiov; uint64_t bytes_done = 0; uint8_t *cluster_data = NULL; - QCowL2Meta *l2meta; + QCowL2Meta *l2meta = NULL; trace_qcow2_writev_start_req(qemu_coroutine_self(), sector_num, remaining_sectors); -- 1.8.0.2