From 4ed5f5ea4598fd4ceb44b205ba051173db08adf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 24 Apr 2012 16:22:31 +0200 Subject: [PATCH] target-i386: Fix x86_cpuid_set_model_id() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Andreas Färber Signed-off-by: Anthony Liguori --- target-i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 3df53ca74b..e1517e65c6 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';