[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/24] block/qcow2-bitmap: fix use of uninitialized p
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 24/24] block/qcow2-bitmap: fix use of uninitialized pointer |
Date: |
Tue, 26 Sep 2017 16:21:33 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
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 <address@hidden>
Message-id: address@hidden
Cc: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2-bitmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index e8d3bdbd6e..14f41d0427 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;
--
2.13.5
- [Qemu-devel] [PULL 04/24] docs: add qemu-block-drivers(7) man page, (continued)
- [Qemu-devel] [PULL 04/24] docs: add qemu-block-drivers(7) man page, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 15/24] block: Base permissions on rw state after reopen, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 11/24] block: Clean up some bad code in the vvfat driver, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 14/24] block: Add reopen queue to bdrv_check_perm(), Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 16/24] block: reopen: Queue children after their parents, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 19/24] iotests: fix 181: enable postcopy-ram capability on target, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 22/24] qcow2: add shrink image support, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 21/24] qcow2: add qcow2_cache_discard, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 23/24] qemu-iotests: add shrinking image test, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 20/24] qemu-img: add --shrink flag for resize, Kevin Wolf, 2017/09/26
- [Qemu-devel] [PULL 24/24] block/qcow2-bitmap: fix use of uninitialized pointer,
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 00/24] Block layer patches, Peter Maydell, 2017/09/27