[Privoxy-commits] [privoxy] 08/09: parse_http_url(): Fail if no host is found when we expected one

User Git git at git.privoxy.org
Wed Jun 18 05:47:05 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 b8f5ec4d1a5eee00548fded12aba5b8d229a7bfb
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Sun May 4 15:08:58 2025 +0200

    parse_http_url(): Fail if no host is found when we expected one
    
    This can happen in case of invalid requests in which case
    Privoxy priviously would leak a couple of bytes of memory.
---
 urlmatch.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/urlmatch.c b/urlmatch.c
index b6a61d96..b213c3eb 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -326,6 +326,11 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr
 
    if (!host_available)
    {
+      if (!require_protocol)
+      {
+         log_error(LOG_LEVEL_ERROR, "No host found in request line.");
+         return JB_ERR_PARSE;
+      }
       /* Without host, there is nothing left to do here */
       return JB_ERR_OK;
    }

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


More information about the Privoxy-commits mailing list