Skip to content

Commit

Permalink
[ftp] Terminate processing after receiving an error
Browse files Browse the repository at this point in the history
When an error reply (not 1xx, 2xx or 3xx) was received, ftp_reply()
invoked ftp_done() to close connections, but did not return, and the
rest of code in this function could try to send commands to the closed
control connection.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
  • Loading branch information
sigprof authored and Michael Brown committed Jul 30, 2008
1 parent 8f4c2b4 commit e6cd169
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/net/tcp/ftp.c
Expand Up @@ -221,6 +221,7 @@ static void ftp_reply ( struct ftp_request *ftp ) {
( ( status_major == '3' ) && ( ftp->state == FTP_USER ) ) ) ){
/* Flag protocol error and close connections */
ftp_done ( ftp, -EPROTO );
return;
}

/* Open passive connection when we get "PASV" response */
Expand Down

0 comments on commit e6cd169

Please sign in to comment.