]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix crash in LXC driver open method when URI has no path
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 11 Feb 2010 15:00:25 +0000 (15:00 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 12 Feb 2010 17:25:19 +0000 (17:25 +0000)
If giving a lxc://  URI instead of lxc:/// the open method
would crash ona NULL pointer

* src/lxc/lxc_driver.c: Cope with a NULL URI path

src/lxc/lxc_driver.c

index 679e93664813e4e690265a05ab42197090898542..f7e9c7d34062d7427043ebfbcba44e3f5475d6d5 100644 (file)
@@ -126,7 +126,8 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn,
             return VIR_DRV_OPEN_DECLINED;
 
         /* If path isn't '/' then they typoed, tell them correct path */
-        if (STRNEQ(conn->uri->path, "/")) {
+        if (conn->uri->path != NULL &&
+            STRNEQ(conn->uri->path, "/")) {
             lxcError(VIR_ERR_INTERNAL_ERROR,
                      _("Unexpected LXC URI path '%s', try lxc:///"),
                      conn->uri->path);