mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-24 04:12:20 +00:00
xenParseXM: don't dereference NULL pointer when script is empty
This commit is contained in:
parent
4bb4109f7b
commit
6dd8532d96
@ -680,8 +680,8 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bridge[0] || STREQ(script, "vif-bridge") ||
|
if (bridge[0] || STREQ_NULLABLE(script, "vif-bridge") ||
|
||||||
STREQ(script, "vif-vnic")) {
|
STREQ_NULLABLE(script, "vif-vnic")) {
|
||||||
net->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
|
net->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
|
||||||
} else {
|
} else {
|
||||||
net->type = VIR_DOMAIN_NET_TYPE_ETHERNET;
|
net->type = VIR_DOMAIN_NET_TYPE_ETHERNET;
|
||||||
@ -698,7 +698,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
|||||||
!(net->data.bridge.ipaddr = strdup(ip)))
|
!(net->data.bridge.ipaddr = strdup(ip)))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
} else {
|
} else {
|
||||||
if (script[0] &&
|
if (script && script[0] &&
|
||||||
!(net->data.ethernet.script = strdup(script)))
|
!(net->data.ethernet.script = strdup(script)))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
if (ip[0] &&
|
if (ip[0] &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user