mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
Avoid a libvirtd crash on broken input 523418
* src/conf/domain_conf.c: a simple typo in an XML domain file could lead to a crash, because we called STRPREFIX() on the looked up value without checking it was non-null.
This commit is contained in:
parent
b37979023d
commit
79d233b5ca
@ -1032,7 +1032,8 @@ virDomainNetDefParseXML(virConnectPtr conn,
|
||||
} else if ((ifname == NULL) &&
|
||||
xmlStrEqual(cur->name, BAD_CAST "target")) {
|
||||
ifname = virXMLPropString(cur, "dev");
|
||||
if (STRPREFIX((const char*)ifname, "vnet")) {
|
||||
if ((ifname != NULL) &&
|
||||
(STRPREFIX((const char*)ifname, "vnet"))) {
|
||||
/* An auto-generated target name, blank it out */
|
||||
VIR_FREE(ifname);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user