From a6ab72a9c3ad475a544ffd53a782e46a02437006 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Tue, 12 Jul 2016 13:44:10 +0200 Subject: [PATCH] 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 --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 16e0736e09..db1a0ffd57 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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) -- GitLab