mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-16 18:25:08 -06:00
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 22d81ceb46
This commit is contained in:
parent
22d81ceb46
commit
7710d236b2
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user