From e6cd16946a2c52f39d3ea308ab1fb80a85c9d0a3 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Wed, 30 Jul 2008 20:27:09 +0100 Subject: [ftp] Terminate processing after receiving an error 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 --- src/net/tcp/ftp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c index 9a12064e..3b88f7b6 100644 --- a/src/net/tcp/ftp.c +++ b/src/net/tcp/ftp.c @@ -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 */ -- cgit v1.2.3-55-g7522