From: squidadm Date: Sat, 1 Feb 2020 11:03:24 +0000 (+1300) Subject: Fix request URL generation in reverse proxy configurations (#550) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d29ac78fd203f55bf391bcb24348ed43ea469d21;p=thirdparty%2Fsquid.git Fix request URL generation in reverse proxy configurations (#550) --- diff --git a/src/client_side.cc b/src/client_side.cc index f14424d61c..3fecf687d6 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2109,9 +2109,9 @@ prepareAcceleratedURL(ConnStateData * conn, ClientHttpRequest *http, char *url, const bool switchedToHttps = conn->switchedToHttps(); const bool tryHostHeader = vhost || switchedToHttps; - if (tryHostHeader && (host = getHostHeader(req_hdr)) != NULL) { + if (tryHostHeader && (host = getHostHeader(req_hdr)) != NULL && strlen(host) >= SQUIDHOSTNAMELEN) { debugs(33, 5, "ACCEL VHOST REWRITE: vhost=" << host << " + vport=" << vport); - char thost[256]; + char thost[SQUIDHOSTNAMELEN + 6 /* ':' vport */]; if (vport > 0) { thost[0] = '\0'; char *t = NULL;