]> Git Repo - qemu.git/commitdiff
block/qcow2-bitmap: fix use of uninitialized pointer
authorVladimir Sementsov-Ogievskiy <[email protected]>
Fri, 22 Sep 2017 14:43:53 +0000 (17:43 +0300)
committerMax Reitz <[email protected]>
Tue, 26 Sep 2017 13:00:32 +0000 (15:00 +0200)
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 <[email protected]>
Message-id: 20170922144353[email protected]
Cc: [email protected]
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
block/qcow2-bitmap.c

index e8d3bdbd6eaf9dd73a5ef6a007a2f4e6f95117d4..14f41d04270a28a9f4be12c3d7ae14f844331796 100644 (file)
@@ -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;
This page took 0.023107 seconds and 4 git commands to generate.