From e9a460411fcbf28c9e8b4e6afba4a7d1efa8bde2 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 18 Mar 2008 22:59:04 +0000 Subject: Fixed an infinite loop when given an invalid SFTP quote command. --- lib/ssh.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/ssh.c b/lib/ssh.c index f8b0f7643..b238e9c3b 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -956,14 +956,14 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) break; } - if(sshc->quote_path1) { - Curl_safefree(sshc->quote_path1); - sshc->quote_path1 = NULL; - } - if(sshc->quote_path2) { - Curl_safefree(sshc->quote_path2); - sshc->quote_path2 = NULL; - } + failf(data, "Unknown SFTP command"); + Curl_safefree(sshc->quote_path1); + sshc->quote_path1 = NULL; + Curl_safefree(sshc->quote_path2); + sshc->quote_path2 = NULL; + state(conn, SSH_SFTP_CLOSE); + sshc->actualcode = CURLE_QUOTE_ERROR; + break; } } if(!sshc->quote_item) { -- cgit v1.2.3