From: Fabian Keil Date: Sun, 4 May 2025 13:08:58 +0000 (+0200) Subject: parse_http_url(): Fail if no host is found when we expected one X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/static/@default-cgi@edit-actions?a=commitdiff_plain;h=b8f5ec4d1a5eee00548fded12aba5b8d229a7bfb;p=privoxy.git 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. --- 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; }