mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: Make really sure we don't access non-existing vCPUs
MinGW complained that we might be dereferencing a NULL pointer. While that can't be true, the logic certainly allows for that. src/conf/domain_conf.c: In function 'virDomainDefGetVcpuPinInfoHelper': src/conf/domain_conf.c:1545:17: error: potential null pointer dereference [-Werror=null-dereference] if (vcpu->cpumask) ~~~~^~~~~~~~~ Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
527968d433
commit
a6ab72a9c3
@ -1542,7 +1542,7 @@ virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
|
||||
virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(def, i);
|
||||
virBitmapPtr bitmap = NULL;
|
||||
|
||||
if (vcpu->cpumask)
|
||||
if (vcpu && vcpu->cpumask)
|
||||
bitmap = vcpu->cpumask;
|
||||
else if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
|
||||
autoCpuset)
|
||||
|
Loading…
x
Reference in New Issue
Block a user