aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2020-03-24 18:36:27 +0300
committerMarkus Armbruster <armbru@redhat.com>2020-04-04 14:15:14 +0200
commitb0e709503cee6e30e62b35ef416a53531371c1a7 (patch)
tree850f0c5b09c0e1dfc1693e85c9758d53a36c852e
parentd1d3a99795006d81f10c98927b0c2ad270bc78fd (diff)
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: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20200324153630.11882-4-vsementsov@virtuozzo.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com>
-rw-r--r--dump/win_dump.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/dump/win_dump.c b/dump/win_dump.c
index eda2a48974..652c7bad99 100644
--- a/dump/win_dump.c
+++ b/dump/win_dump.c
@@ -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);
}
}
}