From: Dan Fandrich Date: Sat, 15 Mar 2014 08:57:41 +0000 (+0100) Subject: ssh: prevent a logic error that could result in an infinite loop X-Git-Tag: curl-7_36_0~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b5b6a2b1a97b4c49e17b781068f14520f4359fd;p=curl ssh: prevent a logic error that could result in an infinite loop --- 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; }