aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-bitmap.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2017-09-22 17:43:53 +0300
committerMax Reitz <mreitz@redhat.com>2017-09-26 15:00:32 +0200
commit5330f32b71b1868bdb3b444733063cb5adc4e8e6 (patch)
tree56a30ece9dc7584b668bd06f98b569d8fb000efc /block/qcow2-bitmap.c
parentfefac70d2a4c2bfb895fdcf2bdc5baf1253eeb74 (diff)
downloadqemu-5330f32b71b1868bdb3b444733063cb5adc4e8e6.zip
qemu-5330f32b71b1868bdb3b444733063cb5adc4e8e6.tar.gz
qemu-5330f32b71b1868bdb3b444733063cb5adc4e8e6.tar.bz2
block/qcow2-bitmap: fix use of uninitialized pointer
Without initialization to zero dirty_bitmap field may be not zero for a bitmap which should not be stored and qcow2_store_persistent_dirty_bitmaps will erroneously call store_bitmap for it which leads to SIGSEGV on bdrv_dirty_bitmap_name. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20170922144353.4220-1-vsementsov@virtuozzo.com Cc: qemu-stable@nongnu.org Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2-bitmap.c')
-rw-r--r--block/qcow2-bitmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index e8d3bdb..14f41d0 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -602,7 +602,7 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,
goto fail;
}
- bm = g_new(Qcow2Bitmap, 1);
+ bm = g_new0(Qcow2Bitmap, 1);
bm->table.offset = e->bitmap_table_offset;
bm->table.size = e->bitmap_table_size;
bm->flags = e->flags;