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. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
ea7697fcd6
commit
4ed5f5ea45
@ -627,6 +627,7 @@ static void x86_cpuid_set_model_id(CPUX86State *env, const char *model_id)
|
|||||||
model_id = "";
|
model_id = "";
|
||||||
}
|
}
|
||||||
len = strlen(model_id);
|
len = strlen(model_id);
|
||||||
|
memset(env->cpuid_model, 0, 48);
|
||||||
for (i = 0; i < 48; i++) {
|
for (i = 0; i < 48; i++) {
|
||||||
if (i >= len) {
|
if (i >= len) {
|
||||||
c = '\0';
|
c = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user