提交 258d59cf 编写于 作者: J Jim Meyering

x86ModelHasFeature: avoid NULL-dereference for unmatched CPU "feature"

* src/cpu/cpu_x86.c (x86ModelHasFeature): Do not dereference the pointer
returned by x86cpuidFind without first ensuring it is non-NULL.
上级 83be6403
......@@ -614,7 +614,7 @@ x86ModelHasFeature(struct x86_model *model,
cpuid = feature->cpuid + i;
model_cpuid = x86cpuidFind(model->cpuid, model->ncpuid,
cpuid->function);
if (!x86cpuidMatchMasked(model_cpuid, cpuid))
if (!model_cpuid || !x86cpuidMatchMasked(model_cpuid, cpuid))
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册