[libvirt] [PATCH] remote: Fix client crash when URI path is empty when using ssh

Peter Krempa pkrempa at redhat.com
Fri Jun 14 08:48:51 UTC 2013


The parsed path in the URI may be NULL resulting into:

  $ virsh -c qemu+ssh:// list
  Segmentation fault (core dumped)

Introduced by 22d81ceb46ea4b83ad817c29b2b04df27a09c671
---
 src/remote/remote_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index bd5646a..87c61f4 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -633,7 +633,7 @@ doRemoteOpen(virConnectPtr conn,
     case trans_libssh2:
         if (!sockname) {
             /* Right now we don't support default session connections */
-            if (STREQ(conn->uri->path, "/session")) {
+            if (STREQ_NULLABLE(conn->uri->path, "/session")) {
                 virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                                _("Connecting to session instance without "
                                  "socket path is not supported by the libssh2 "
@@ -710,7 +710,7 @@ doRemoteOpen(virConnectPtr conn,

         if (!sockname) {
             /* Right now we don't support default session connections */
-            if (STREQ(conn->uri->path, "/session")) {
+            if (STREQ_NULLABLE(conn->uri->path, "/session")) {
                 virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                                _("Connecting to session instance without "
                                  "socket path is not supported by the ssh "
-- 
1.8.2.1




More information about the libvir-list mailing list