From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8Fg-0002MX-TN for qemu-devel@nongnu.org; Thu, 01 Sep 2011 10:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz8Ff-0008Gq-Oz for qemu-devel@nongnu.org; Thu, 01 Sep 2011 10:28:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8Ff-0008GM-E3 for qemu-devel@nongnu.org; Thu, 01 Sep 2011 10:28:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p81ESIQl017523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Sep 2011 10:28:18 -0400 From: Kevin Wolf Date: Thu, 1 Sep 2011 16:31:09 +0200 Message-Id: <1314887471-18052-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1314887471-18052-1-git-send-email-kwolf@redhat.com> References: <1314887471-18052-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] qcow2: Properly initialise QcowL2Meta List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, lcapitulino@redhat.com Dependency list pointers filled with random garbage from the stack aren't a good idea. Signed-off-by: Kevin Wolf --- block/qcow2.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index b725d68..f26f7b6 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -526,13 +526,14 @@ static int qcow2_co_writev(BlockDriverState *bs, int n_end; int ret; int cur_nr_sectors; /* number of sectors in current iteration */ - QCowL2Meta l2meta; uint64_t cluster_offset; QEMUIOVector hd_qiov; uint64_t bytes_done = 0; uint8_t *cluster_data = NULL; + QCowL2Meta l2meta = { + .nb_clusters = 0, + }; - l2meta.nb_clusters = 0; qemu_co_queue_init(&l2meta.dependent_requests); qemu_iovec_init(&hd_qiov, qiov->niov); -- 1.7.6