1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

vz: Fix invalid iteration of def->cputune.vcpupin

The array doesn't necessarily have the same cardinality as the count of
vCPUs for a domain. Iterating it can cause access beyond the end of the
array.
This commit is contained in:
Peter Krempa 2015-12-18 16:55:01 +01:00
parent b3c91b8a50
commit 68ee703bfe

View File

@ -1958,7 +1958,7 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
}
if (def->cputune.vcpupin) {
for (i = 0; i < virDomainDefGetVcpus(def); i++) {
for (i = 0; i < def->cputune.nvcpupin; i++) {
if (!virBitmapEqual(def->cpumask,
def->cputune.vcpupin[i]->cpumask)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,