mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
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.
This commit is contained in:
parent
f983c32675
commit
320ea3a47e
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user