qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 01/15] target-i386: Fix x86_cpuid_set_model_id()


From: Andreas Färber
Subject: [Qemu-devel] [PATCH v3 01/15] target-i386: Fix x86_cpuid_set_model_id()
Date: Wed, 25 Apr 2012 11:23:22 +0200

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 <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
[AF: Use memset() instead of for loop, suggested by Igor]
Signed-off-by: Andreas Färber <address@hidden>
---
 target-i386/cpu.c |    1 +
 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';
-- 
1.7.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]