]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Squid segfault via Ftp::Client::readControlReply().
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 5 Aug 2016 14:59:33 +0000 (02:59 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 5 Aug 2016 14:59:33 +0000 (02:59 +1200)
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.

src/clients/FtpClient.cc

index bf4a5add070fc2a8a5df70c587b8b4657edf6d2a..ee95a90ed33bfcff988fc942304193a0d8250f69 100644 (file)
@@ -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.