diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index a09f5fcd56..4965b3e6cf 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -1175,6 +1175,12 @@ virNetworkPortGroupParseXML(virPortGroupDefPtr def, /* grab raw data from XML */ def->name = virXPathString("string(./@name)", ctxt); + if (!def->name) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Missing required name attribute in portgroup")); + goto error; + } + isDefault = virXPathString("string(./@default)", ctxt); def->isDefault = isDefault && STRCASEEQ(isDefault, "yes");