]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixes a squid crash when a foreign protocol client connected to an https_port
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 26 Sep 2014 09:54:50 +0000 (12:54 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 26 Sep 2014 09:54:50 +0000 (12:54 +0300)
The Ssl::Bio::read will fail to recognize SSL protocol and will return "-1"
as readed SSL bytes. The Ssl::ClientBio::read must return error (-1)
in this case.

This is a Measurement Factory project

src/ssl/bio.cc

index dd34014d74d4717cccffe6c25952f807af4ccb88..75c810d07eec56073fbf43512f29ef943c79a771 100644 (file)
@@ -203,8 +203,8 @@ Ssl::ClientBio::read(char *buf, int size, BIO *table)
             return 0;
 
         int bytes = Ssl::Bio::read(buf, size, table);
-        if (!bytes)
-            return 0;
+        if (bytes <= 0)
+            return bytes;
         rbuf.append(buf, bytes);
         debugs(83, 7, "rbuf size: " << rbuf.contentSize());
     }