提交 fa170c14 编写于 作者: C Charles Arnold 提交者: Kevin Wolf

qemu-img: Fix segmentation fault

The following command generates a segmentation fault.
qemu-img convert -O vpc -o ? test test2
This is because the 'goto out;' statement calls qemu_progress_end
before qemu_progress_init is called resulting in a NULL pointer
invocation.
Signed-off-by: NCharles Arnold <carnold@suse.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 c44bfe46
......@@ -712,6 +712,9 @@ static int img_convert(int argc, char **argv)
out_filename = argv[argc - 1];
/* Initialize before goto out */
qemu_progress_init(progress, 2.0);
if (options && !strcmp(options, "?")) {
ret = print_block_option_help(out_filename, out_fmt);
goto out;
......@@ -724,7 +727,6 @@ static int img_convert(int argc, char **argv)
goto out;
}
qemu_progress_init(progress, 2.0);
qemu_progress_print(0, 100);
bs = g_malloc0(bs_n * sizeof(BlockDriverState *));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册