From d6c54f932054c58aee8f7a6d2bd49b115d804da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Wed, 1 Apr 2020 11:08:43 +0300 Subject: libfetch: fix no_proxy domain name comparision Fix comparing of the hostname portion that matches exactly. The no_proxy matching is pretty rudimentary though and probably could go through a bit of additional rework. Fixes #10681 --- libfetch/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfetch/common.c b/libfetch/common.c index e237828..9cbe32d 100644 --- a/libfetch/common.c +++ b/libfetch/common.c @@ -1085,7 +1085,7 @@ fetch_no_proxy_match(const char *host) break; d_len = q - p; - if (d_len > 0 && h_len > d_len && + if (d_len > 0 && h_len >= d_len && strncasecmp(host + h_len - d_len, p, d_len) == 0) { /* domain name matches */ -- cgit v1.2.3