From: Sergey Vlasov Date: Wed, 30 Jul 2008 19:27:09 +0000 (+0100) Subject: [ftp] Terminate processing after receiving an error X-Git-Tag: v0.9.4~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6cd16946a2c52f39d3ea308ab1fb80a85c9d0a3;p=thirdparty%2Fipxe.git [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 --- diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c index 9a12064e1..3b88f7b6b 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 */