mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00: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 22d81ceb46ea4b83ad817c29b2b04df27a09c671
This commit is contained in:
parent
22d81ceb46
commit
7710d236b2
@ -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 "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user