From 2d6659e7786851d0c54f038ada81bf711905e2ef Mon Sep 17 00:00:00 2001 From: Nikolai Barybin Date: Tue, 27 Jun 2023 11:43:58 +0300 Subject: [PATCH] qemu: prevent SIGSEGV in qemuProcessHandleDumpCompleted If VIR_ASYNC_JOB_NONE flag is present, job.current is equal to NULL, which leads to SIGSEGV. Thus, this check should be moved up. Fixes: v8.0.0-427-gf304de0df6 Signed-off-by: Nikolai Barybin Reviewed-by: Jiri Denemark --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d3b1bdf6a4..db06991450 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1601,11 +1601,11 @@ qemuProcessHandleDumpCompleted(qemuMonitor *mon G_GNUC_UNUSED, vm, vm->def->name, stats, NULLSTR(error)); jobPriv = vm->job->privateData; - privJobCurrent = vm->job->current->privateData; if (vm->job->asyncJob == VIR_ASYNC_JOB_NONE) { VIR_DEBUG("got DUMP_COMPLETED event without a dump_completed job"); goto cleanup; } + privJobCurrent = vm->job->current->privateData; jobPriv->dumpCompleted = true; privJobCurrent->stats.dump = *stats; vm->job->error = g_strdup(error); -- 2.39.5