From: Christos Tsantilas Date: Wed, 27 Jul 2016 08:18:03 +0000 (+0300) Subject: Squid segfault via Ftp::Client::readControlReply(). X-Git-Tag: SQUID_4_0_13~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cbe840328ada24814e3decf97214a0202d8764d4;p=thirdparty%2Fsquid.git Squid segfault via Ftp::Client::readControlReply(). Ftp::Client::scheduleReadControlReply(), which may called from the asynchronous start() or readControlReply()/handleControlReply() handlers, does not check whether the control connection is still usable before using it. This is a Measurement Factory project. --- diff --git a/src/clients/FtpClient.cc b/src/clients/FtpClient.cc index 0c4a2503d0..d7d0eb31ed 100644 --- a/src/clients/FtpClient.cc +++ b/src/clients/FtpClient.cc @@ -314,6 +314,11 @@ Ftp::Client::scheduleReadControlReply(int buffered_ok) /* We've already read some reply data */ handleControlReply(); } else { + + if (!Comm::IsConnOpen(ctrl.conn)) { + debugs(9, 3, "cannot read without ctrl " << ctrl.conn); + return; + } /* * Cancel the timeout on the Data socket (if any) and * establish one on the control socket.