------------------------------------------------------------ revno: 13608 revision-id: chtsanti@users.sourceforge.net-20140926095450-okridmjwzva5h2lz parent: chtsanti@users.sourceforge.net-20140926093248-dbcu6r0t95roar6g committer: Christos Tsantilas branch nick: trunk timestamp: Fri 2014-09-26 12:54:50 +0300 message: Fixes a squid crash when a foreign protocol client connected to an https_port 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 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: chtsanti@users.sourceforge.net-20140926095450-\ # okridmjwzva5h2lz # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 474d59e0d32b0229f392e5c3198e0489d08c9a98 # timestamp: 2014-10-02 09:21:22 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: chtsanti@users.sourceforge.net-20140926093248-\ # dbcu6r0t95roar6g # # Begin patch === modified file 'src/ssl/bio.cc' --- src/ssl/bio.cc 2014-09-13 13:59:43 +0000 +++ src/ssl/bio.cc 2014-09-26 09:54:50 +0000 @@ -203,8 +203,8 @@ 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()); }