mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
x86Decode: avoid NULL-dereference upon questionable input
* src/cpu/cpu_x86.c (x86Decode): Don't dereference NULL when passed a NULL "models" pointer, or when passed a nonzero "nmodels" value and a corresponding NULL models[i].
This commit is contained in:
parent
23e93d95b5
commit
e749d77619
@ -998,7 +998,7 @@ x86Decode(virCPUDefPtr cpu,
|
||||
}
|
||||
|
||||
for (i = 0; i < nmodels; i++) {
|
||||
if (STREQ(models[i], candidate->name)) {
|
||||
if (models && models[i] && STREQ(models[i], candidate->name)) {
|
||||
allowed = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user