X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=urlmatch.c;h=23a6b54363ef76250638ba13a27f40625146eb0a;hp=868a16b3806d94cb65adb251727d90cceac58c6a;hb=86fab7a17deee6174219f9c5fe7612930743770e;hpb=8666662f482bbfbb9c8407af506b5b82e2ef0dae diff --git a/urlmatch.c b/urlmatch.c index 868a16b3..23a6b543 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -45,7 +45,7 @@ #include #include -#if !defined(_WIN32) && !defined(__OS2__) +#if !defined(_WIN32) #include #endif @@ -302,7 +302,7 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr url_path ); *url_path = '\0'; - http->hostport = strdup_or_die(url_noproto); + http->hostport = string_tolower(url_noproto); } else { @@ -311,10 +311,15 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr * or CONNECT requests */ http->path = strdup_or_die("/"); - http->hostport = strdup_or_die(url_noproto); + http->hostport = string_tolower(url_noproto); } freez(buf); + + if (http->hostport == NULL) + { + return JB_ERR_PARSE; + } } if (!host_available) @@ -1301,7 +1306,8 @@ static int host_matches(const struct http_request *http, { assert(http->host != NULL); #ifdef FEATURE_PCRE_HOST_PATTERNS - if (pattern->pattern.url_spec.host_regex_type == PCRE_HOST_PATTERN) { + if (pattern->pattern.url_spec.host_regex_type == PCRE_HOST_PATTERN) + { return ((NULL == pattern->pattern.url_spec.host_regex) || (0 == regexec(pattern->pattern.url_spec.host_regex, http->host, 0, NULL, 0)));