diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-12-22 18:13:39 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-12-22 18:14:57 +0100 |
commit | c98ee5f67f497195c9127cc70fa53a487f994cd5 (patch) | |
tree | c64c03588f4600d30b63be17900a72281c419fa9 | |
parent | 85f9aa08d9ba78843e18b6eda83c81a2f92a729d (diff) |
libssh: no data pointer == nothing to do
-rw-r--r-- | lib/ssh-libssh.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c index 2e920f0e9..77dc098f2 100644 --- a/lib/ssh-libssh.c +++ b/lib/ssh-libssh.c @@ -554,14 +554,19 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SSHPROTO *protop = data->req.protop; + struct SSHPROTO *protop; struct ssh_conn *sshc = &conn->proto.sshc; int rc = SSH_NO_ERROR, err; char *new_readdir_line; int seekerr = CURL_SEEKFUNC_OK; const char *err_msg; *block = 0; /* we're not blocking by default */ + if(!data) { + state(conn, SSH_STOP); + return CURLE_OK; + } + protop = data->req.protop; do { switch(sshc->state) { @@ -1988,6 +1993,10 @@ static CURLcode myssh_block_statemach(struct connectdata *conn, struct ssh_conn *sshc = &conn->proto.sshc; CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; + if(!data) { + state(conn, SSH_STOP); + return CURLE_OK; + } while((sshc->state != SSH_STOP) && !result) { bool block; |