From: Christos Tsantilas Date: Fri, 26 Sep 2014 09:54:50 +0000 (+0300) Subject: Fixes a squid crash when a foreign protocol client connected to an https_port X-Git-Tag: SQUID_3_5_0_1~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=869b432824fc0209896120f5ee7ce7cc5cd1cbcd;p=thirdparty%2Fsquid.git 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 --- diff --git a/src/ssl/bio.cc b/src/ssl/bio.cc index dd34014d74..75c810d07e 100644 --- a/src/ssl/bio.cc +++ b/src/ssl/bio.cc @@ -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()); }