]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix request URL generation in reverse proxy configurations (#550)
authorsquidadm <squidadm@users.noreply.github.com>
Sat, 1 Feb 2020 11:03:24 +0000 (00:03 +1300)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2020 11:03:24 +0000 (00:03 +1300)
src/client_side.cc

index f14424d61cde37a3cb73964ecf340474893fa852..3fecf687d693862ea400374567f31cdb8eca1e31 100644 (file)
@@ -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;