提交 b0e70950 编写于 作者: V Vladimir Sementsov-Ogievskiy 提交者: Markus Armbruster

dump/win_dump: fix use after free of err

It's possible that we'll try to set err twice (or more). It's bad, it
will crash.

Instead, use warn_report().
Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200324153630.11882-4-vsementsov@virtuozzo.com>
Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 d1d3a997
......@@ -304,13 +304,11 @@ static void restore_context(WinDumpHeader64 *h,
struct saved_context *saved_ctx)
{
int i;
Error *err = NULL;
for (i = 0; i < h->NumberProcessors; i++) {
if (cpu_memory_rw_debug(first_cpu, saved_ctx[i].addr,
(uint8_t *)&saved_ctx[i].ctx, sizeof(WinContext), 1)) {
error_setg(&err, "win-dump: failed to restore CPU #%d context", i);
warn_report_err(err);
warn_report("win-dump: failed to restore CPU #%d context", i);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册