From: Kevin Wolf Date: Thu, 1 Sep 2011 13:00:42 +0000 (+0200) Subject: qcow2: Properly initialise QcowL2Meta X-Git-Tag: TizenStudio_2.0_p2.3~2346^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4d1e4765e8083eb2f88bbcba77750fafc367344;p=sdk%2Femulator%2Fqemu.git qcow2: Properly initialise QcowL2Meta Dependency list pointers filled with random garbage from the stack aren't a good idea. Signed-off-by: Kevin Wolf --- 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);