diff options
author | Jim Meyering <meyering@redhat.com> | 2010-05-17 14:06:13 +0200 |
---|---|---|
committer | Doug Goldstein <cardoe@gentoo.org> | 2010-05-26 11:57:34 -0500 |
commit | 526d0c99e6dbf386e593e261c726332593cf4033 (patch) | |
tree | f967c79c18e702efa2bf7cc252a311856ecf63ce | |
parent | qemu: Report cmdline output if VM dies early (diff) | |
download | libvirt-526d0c99e6dbf386e593e261c726332593cf4033.tar.gz libvirt-526d0c99e6dbf386e593e261c726332593cf4033.tar.bz2 libvirt-526d0c99e6dbf386e593e261c726332593cf4033.zip |
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.
-rw-r--r-- | src/cpu/cpu_x86.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 633eb69e5..f7473bffb 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -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; } |