Fixed an infinite loop when given an invalid SFTP quote command.

This commit is contained in:
Dan Fandrich
2008-03-18 22:59:04 +00:00
parent a57098ea9b
commit e9a460411f
5 changed files with 13 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
Daniel Fandrich (18 Mar 2008) Daniel Fandrich (18 Mar 2008)
- Added test 626 to reproduce an infinite loop when given an invalid - Added test 626 to reproduce an infinite loop when given an invalid
SFTP quote command reported by Vincent Le Normand, but left it disabled. SFTP quote command reported by Vincent Le Normand, and fixed it.
Michal Marek (18 Mar 2008) Michal Marek (18 Mar 2008)
- Added curl_easy_getinfo typechecker. - Added curl_easy_getinfo typechecker.

View File

@@ -46,6 +46,7 @@ This release includes the following bugfixes:
o sharing DNS cache between easy handles running in multiple threads could o sharing DNS cache between easy handles running in multiple threads could
lead to crash lead to crash
o SFTP upload with CURLOPT_FTP_CREATE_MISSING_DIRS on re-used connection o SFTP upload with CURLOPT_FTP_CREATE_MISSING_DIRS on re-used connection
o SFTP infinite loop when given an invalid quote command
This release includes the following known bugs: This release includes the following known bugs:

View File

@@ -956,14 +956,14 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
break; break;
} }
if(sshc->quote_path1) { failf(data, "Unknown SFTP command");
Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path1);
sshc->quote_path1 = NULL; sshc->quote_path1 = NULL;
} Curl_safefree(sshc->quote_path2);
if(sshc->quote_path2) { sshc->quote_path2 = NULL;
Curl_safefree(sshc->quote_path2); state(conn, SSH_SFTP_CLOSE);
sshc->quote_path2 = NULL; sshc->actualcode = CURLE_QUOTE_ERROR;
} break;
} }
} }
if(!sshc->quote_item) { if(!sshc->quote_item) {

View File

@@ -4,4 +4,3 @@
# per line. # per line.
# Lines starting with '#' letters are treated as comments. # Lines starting with '#' letters are treated as comments.
617 617
626

View File

@@ -32,9 +32,9 @@ Test file for rename test
# #
# Verify data after the test has been "shot" # Verify data after the test has been "shot"
<verify> <verify>
<file name="log/file626-renamed.txt"> <errorcode>
Test file for rename test 21
</file> </errorcode>
<valgrind> <valgrind>
disable disable
</valgrind> </valgrind>