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.
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;