From: Peter Krempa Date: Thu, 28 May 2015 14:22:13 +0000 (+0200) Subject: qemu: Fix possible crash in qemuProcessSetVcpuAffinities X-Git-Tag: v1.2.17-rc1~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff4c42ed7a917635fb93e9d5b2120b2d22d86504;p=thirdparty%2Flibvirt.git qemu: Fix possible crash in qemuProcessSetVcpuAffinities In case when is not specified, the vcpupin array is not guaranteed to be allocated to def->vcpus. This would cause a crash for TCG since it does not report thread IDs for vCPUs. --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9c5d0f4893..f2b22292f4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2376,7 +2376,7 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm) /* If any CPU has custom affinity that differs from the * VM default affinity, we must reject it */ - for (n = 0; n < def->vcpus; n++) { + for (n = 0; n < def->cputune.nvcpupin; n++) { if (!virBitmapEqual(def->cpumask, def->cputune.vcpupin[n]->cpumask)) { virReportError(VIR_ERR_OPERATION_INVALID,