]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Squid segfault via Ftp::Client::readControlReply().
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 27 Jul 2016 08:18:03 +0000 (11:18 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 27 Jul 2016 08:18:03 +0000 (11:18 +0300)
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 0c4a2503d08f70b03cc235325d04882acd9c21bd..d7d0eb31ed446c21f660aca3550fd6f874804771 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.