]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix segfault if virtual network does not have a bridge name
authorCole Robinson <crobinso@redhat.com>
Thu, 11 Dec 2008 14:57:45 +0000 (14:57 +0000)
committerCole Robinson <crobinso@redhat.com>
Thu, 11 Dec 2008 14:57:45 +0000 (14:57 +0000)
ChangeLog
src/network_driver.c
src/qemu_conf.c

index 000b66d056987c8684dacb821f4242cbb6a6792f..5d39d14499c4a014abaef8c801622ceaf190d894 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * src/domain_conf.c src/domain_conf.h src/qemu_conf.c
index f233dca90230424fb34a32683fcf9b64e9458705..0978341d0961dee9ba3ef517df96b835d396c5fe 100644 (file)
@@ -1182,6 +1182,13 @@ static char *networkGetBridgeName(virNetworkPtr net) {
         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);
     if (!bridge)
         networkReportError(net->conn, NULL, net, VIR_ERR_NO_MEMORY,
index 3b846a3e198e5eca938771b2ef7b6928802ec988..8c24cea8c7e85127433f6bcb097d3ead39f5c513 100644 (file)
@@ -549,9 +549,6 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
         virNetworkFree(network);
 
         if (brname == NULL) {
-            qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                             _("Network '%s' is not active"),
-                             net->data.network.name);
             goto error;
         }
     } else if (net->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {