提交 320ea3a4 编写于 作者: J Jim Fehlig 提交者: Jiri Denemark

Only parse 'CPU XML' in virCPUDefParseXML()

Received report of user crashing libvirtd with

virsh capabilities > capabilities.xml
virsh cpu-compare capabilities.xml

While user has been informed about proper usage of cpu-compare,
segfaulting libvirt should be avoided.

Do not parse CPU definition in virCPUDefParseXML() if XML is not
a 'cpu' node.
上级 f983c326
......@@ -115,6 +115,13 @@ virCPUDefParseXML(const xmlNodePtr node,
int n;
unsigned int i;
if (!xmlStrEqual(node->name, BAD_CAST "cpu")) {
virCPUReportError(VIR_ERR_INTERNAL_ERROR,
"%s",
_("XML does not contain expected 'cpu' element"));
return NULL;
}
if (VIR_ALLOC(def) < 0) {
virReportOOMError();
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册