提交 e749d776 编写于 作者: J Jim Meyering

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].
上级 23e93d95
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册