From 7710d236b223c4f7bcb0a348c296d59a5955d9bd Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 14 Jun 2013 10:41:29 +0200 Subject: [PATCH] remote: Fix client crash when URI path is empty when using ssh 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 bd5646adcd..87c61f4157 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 " -- GitLab