mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Fix segfault if virtual network does not have a bridge name
This commit is contained in:
parent
a3d570c7b9
commit
52037657dc
@ -1,3 +1,8 @@
|
|||||||
|
Thu Dec 11 09:55:23 EST 2008 Cole Robinson <crobinso@redhat.com>
|
||||||
|
|
||||||
|
* src/netork_driver.c src/qemu_conf.c: Fix segfault if virtual
|
||||||
|
network does not have a bridge name.
|
||||||
|
|
||||||
Thu Dec 11 12:39:20 CET 2008 Daniel Veillard <veillard@redhat.com>
|
Thu Dec 11 12:39:20 CET 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
|
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
|
||||||
|
@ -1182,6 +1182,13 @@ static char *networkGetBridgeName(virNetworkPtr net) {
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(network->def->bridge)) {
|
||||||
|
networkReportError(net->conn, NULL, net, VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("network '%s' does not have a bridge name."),
|
||||||
|
network->def->name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
bridge = strdup(network->def->bridge);
|
bridge = strdup(network->def->bridge);
|
||||||
if (!bridge)
|
if (!bridge)
|
||||||
networkReportError(net->conn, NULL, net, VIR_ERR_NO_MEMORY,
|
networkReportError(net->conn, NULL, net, VIR_ERR_NO_MEMORY,
|
||||||
|
@ -549,9 +549,6 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
|
|||||||
virNetworkFree(network);
|
virNetworkFree(network);
|
||||||
|
|
||||||
if (brname == NULL) {
|
if (brname == NULL) {
|
||||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Network '%s' is not active"),
|
|
||||||
net->data.network.name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (net->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
|
} else if (net->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user