aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-03-15 09:57:41 +0100
committerDan Fandrich <dan@coneharvesters.com>2014-03-15 10:26:29 +0100
commit9b5b6a2b1a97b4c49e17b781068f14520f4359fd (patch)
tree141759071c09e85d09a11c9ccc316ac89091db11
parentca7d1de69c73a6c19a1a5b7ee33a0b12c5e06d6a (diff)
ssh: prevent a logic error that could result in an infinite loop
-rw-r--r--lib/ssh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 5895a10cb..ad6d3226e 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -2204,7 +2204,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
/* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT
After nextstate is executed,the control should come back to
SSH_SFTP_CLOSE to pass the correct result back */
- if(sshc->nextstate != SSH_NO_STATE) {
+ if(sshc->nextstate != SSH_NO_STATE &&
+ sshc->nextstate != SSH_SFTP_CLOSE) {
state(conn, sshc->nextstate);
sshc->nextstate = SSH_SFTP_CLOSE;
}