[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/3] x86/cpuid: Fix crash on -cpu ""
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 3/3] x86/cpuid: Fix crash on -cpu "" |
Date: |
Tue, 8 Nov 2011 15:36:50 +0100 |
Spotted by Coverity.
Signed-off-by: Markus Armbruster <address@hidden>
---
target-i386/cpuid.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 0fce752..9fc9769 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -613,9 +613,9 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def,
const char *cpu_model)
uint32_t numvalue;
for (def = x86_defs; def; def = def->next)
- if (!strcmp(name, def->name))
+ if (name && !strcmp(name, def->name))
break;
- if (kvm_enabled() && strcmp(name, "host") == 0) {
+ if (kvm_enabled() && name && strcmp(name, "host") == 0) {
cpu_x86_fill_host(x86_cpu_def);
} else if (!def) {
goto error;
--
1.7.6.4