commit d29ac78fd203f55bf391bcb24348ed43ea469d21 Author: squidadm Date: 2020-02-02 00:03:24 +1300 Fix request URL generation in reverse proxy configurations (#550) diff --git a/src/client_side.cc b/src/client_side.cc index f14424d..3fecf68 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;