aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-04-17 18:21:52 +0200
committerAndreas Färber <afaerber@suse.de>2012-04-25 10:45:46 +0200
commitd0a6acf456a2497ce9f70f8366a5b405745ba279 (patch)
tree51fed753d055a071345c4c79a4444558055f324b /target-i386
parentcf36b31db209a261ee3bc2737e788e1ced0a1bec (diff)
downloadqemu-d0a6acf456a2497ce9f70f8366a5b405745ba279.zip
qemu-d0a6acf456a2497ce9f70f8366a5b405745ba279.tar.gz
qemu-d0a6acf456a2497ce9f70f8366a5b405745ba279.tar.bz2
target-i386: Fix x86_cpuid_set_model_id()
Don't assume zeroed cpuid_model[] fields. This didn't break anything yet but QOM properties should be able to set the value to something else without setting an intermediate zero string. Reviewed-by: Eduardo Habhost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> [AF: Use memset() instead of for loop, suggested by Igor] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/cpu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 3df53ca..e1517e6 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -627,6 +627,7 @@ static void x86_cpuid_set_model_id(CPUX86State *env, const char *model_id)
model_id = "";
}
len = strlen(model_id);
+ memset(env->cpuid_model, 0, 48);
for (i = 0; i < 48; i++) {
if (i >= len) {
c = '\0';