mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
x86ModelHasFeature: avoid NULL-dereference for unmatched CPU "feature"
* src/cpu/cpu_x86.c (x86ModelHasFeature): Do not dereference the pointer returned by x86cpuidFind without first ensuring it is non-NULL.
This commit is contained in:
parent
83be64034a
commit
258d59cff9
@ -614,7 +614,7 @@ x86ModelHasFeature(struct x86_model *model,
|
||||
cpuid = feature->cpuid + i;
|
||||
model_cpuid = x86cpuidFind(model->cpuid, model->ncpuid,
|
||||
cpuid->function);
|
||||
if (!x86cpuidMatchMasked(model_cpuid, cpuid))
|
||||
if (!model_cpuid || !x86cpuidMatchMasked(model_cpuid, cpuid))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user