From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhs-0001Ff-86 for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0xhm-0003i8-AY for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhm-0003hu-2y for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:36:54 -0400 From: Kevin Wolf Date: Tue, 6 Sep 2011 17:39:17 +0200 Message-Id: <1315323586-23840-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1315323586-23840-1-git-send-email-kwolf@redhat.com> References: <1315323586-23840-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 02/31] qcow2: Properly initialise QcowL2Meta List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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