unicorn/qemu
Eduardo Habkost 181524d695
i386: Change X86CPUDefinition::model_id to const char*
It is valid to have a 48-character model ID on CPUID, however the
definition of X86CPUDefinition::model_id is char[48], which can
make the compiler drop the null terminator from the string.

If a CPU model happens to have 48 bytes on model_id, "-cpu help"
will print garbage and the object_property_set_str() call at
x86_cpu_load_def() will read data outside the model_id array.

We could increase the array size to 49, but this would mean the
compiler would not issue a warning if a 49-char string is used by
mistake for model_id.

To make things simpler, simply change model_id to be const char*,
and validate the string length using an assert() on
x86_register_cpudef_type().

Backports commit 4b220d88ba76fb2623ce4b8ba1f1eea66b82144e from qemu
2018-03-05 13:48:29 -05:00
..
accel tcg: Merge opcode arguments into TCGOp 2018-03-05 04:45:20 -05:00
crypto
default-configs
docs
fpu
hw
include osdep.h: Make TIME_MAX handle different time_t types 2018-03-05 13:48:29 -05:00
qapi
qobject
qom
scripts
target i386: Change X86CPUDefinition::model_id to const char* 2018-03-05 13:48:29 -05:00
tcg tcg/s390x: Use constant pool for prologue 2018-03-05 11:28:39 -05:00
util
aarch64.h
aarch64eb.h
accel.c
arm.h
armeb.h
atomic_template.h tcg: Record code_gen_buffer address for user-only memory helpers 2018-03-05 13:48:27 -05:00
CODING_STYLE
configure build: disable -Wmissing-braces on older compilers 2018-03-05 11:29:54 -05:00
COPYING
COPYING.LIB
cpu-exec-common.c
cpu-exec.c
cpus.c
cputlb.c tcg: Record code_gen_buffer address for user-only memory helpers 2018-03-05 13:48:28 -05:00
exec.c qom: Introduce CPUClass.tcg_initialize 2018-03-05 09:49:26 -05:00
gen_all_header.sh
glib_compat.c
HACKING
header_gen.py qom: Introduce CPUClass.tcg_initialize 2018-03-05 09:49:26 -05:00
ioport.c
LICENSE
m68k.h
Makefile
Makefile.objs
Makefile.target
memory.c
memory_ldst.inc.c
memory_mapping.c
mips.h
mips64.h
mips64el.h
mipsel.h
powerpc.h
qapi-schema.json
qemu-timer.c
rules.mak
softmmu_template.h
sparc.h qom: Introduce CPUClass.tcg_initialize 2018-03-05 09:49:26 -05:00
sparc64.h qom: Introduce CPUClass.tcg_initialize 2018-03-05 09:49:26 -05:00
tcg-runtime.c
translate-all.c tcg: Merge opcode arguments into TCGOp 2018-03-05 04:45:20 -05:00
translate-all.h translate-all.c: Compute L1 page table properties at runtime 2018-02-26 11:46:58 -05:00
translate-common.c
unicorn_common.h
VERSION
vl.c
vl.h
x86_64.h