mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-14 15:14:42 -05: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:
@@ -633,7 +633,7 @@ doRemoteOpen(virConnectPtr conn,
|
|||||||
case trans_libssh2:
|
case trans_libssh2:
|
||||||
if (!sockname) {
|
if (!sockname) {
|
||||||
/* Right now we don't support default session connections */
|
/* 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",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("Connecting to session instance without "
|
_("Connecting to session instance without "
|
||||||
"socket path is not supported by the libssh2 "
|
"socket path is not supported by the libssh2 "
|
||||||
@@ -710,7 +710,7 @@ doRemoteOpen(virConnectPtr conn,
|
|||||||
|
|
||||||
if (!sockname) {
|
if (!sockname) {
|
||||||
/* Right now we don't support default session connections */
|
/* 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",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("Connecting to session instance without "
|
_("Connecting to session instance without "
|
||||||
"socket path is not supported by the ssh "
|
"socket path is not supported by the ssh "
|
||||||
|
|||||||
Reference in New Issue
Block a user