mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
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>
This commit is contained in:
parent
fefac70d2a
commit
5330f32b71
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user