[Privoxy-commits] [privoxy] 02/07: Don't forward unsupported Connection keywords if there are "too many" keywords to parse

User Git git at git.privoxy.org
Tue Jun 24 14:10:21 CEST 2025


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit 68a6961918d3b9847397ed1ee80f76c1a302f28a
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Thu Jun 19 12:14:07 2025 +0200

    Don't forward unsupported Connection keywords if there are "too many" keywords to parse
---
 parsers.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/parsers.c b/parsers.c
index 605f54a0..04e7ee00 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1895,6 +1895,22 @@ static jb_err server_connection(struct client_state *csp, char **header)
          freez(old_header);
       }
    }
+   else
+   {
+      if (strcmpic(*header, "Connection: close"))
+      {
+         /*
+          * This can happen if there are "too many" keywords
+          * in the connection header.
+          */
+         char *old_header = *header;
+
+         *header = strdup_or_die("Connection: close");
+         log_error(LOG_LEVEL_HEADER, "Replaced: \'%s\' with \'%s\'",
+            old_header, *header);
+         freez(old_header);
+      }
+   }
 
    /* Signal server_connection_adder() to return early. */
    csp->flags |= CSP_FLAG_SERVER_CONNECTION_HEADER_SET;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list