[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 87/411: http_proxy: do not crash with HTTPS_PROXY and NO_PROXY s
From: |
gnunet |
Subject: |
[gnurl] 87/411: http_proxy: do not crash with HTTPS_PROXY and NO_PROXY set |
Date: |
Wed, 13 Jan 2021 01:18:22 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 3eff1c5092e542819ac7e6454a70c94b36ab2a40
Author: Martin Bašti <mbasti@redhat.com>
AuthorDate: Thu Aug 27 23:09:56 2020 +0200
http_proxy: do not crash with HTTPS_PROXY and NO_PROXY set
... in case NO_PROXY takes an effect
Without this patch, the following command crashes:
$ GIT_CURL_VERBOSE=1 NO_PROXY=github.com
HTTPS_PROXY=https://example.com \
git clone https://github.com/curl/curl.git
Minimal libcurl-based reproducer:
#include <curl/curl.h>
int main() {
CURL *curl = curl_easy_init();
if(curl) {
CURLcode ret;
curl_easy_setopt(curl, CURLOPT_URL, "https://github.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "example.com");
/* set the proxy type */
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS);
curl_easy_setopt(curl, CURLOPT_NOPROXY, "github.com");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
return ret;
}
return -1;
}
Assisted-by: Kamil Dudka
Bug: https://bugzilla.redhat.com/1873327
Closes #5902
---
lib/url.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/url.c b/lib/url.c
index d342c4e69..2f02a0a16 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2556,6 +2556,9 @@ static CURLcode create_conn_helper_init_proxy(struct
connectdata *conn)
conn->bits.socksproxy = FALSE;
conn->bits.proxy_user_passwd = FALSE;
conn->bits.tunnel_proxy = FALSE;
+ /* CURLPROXY_HTTPS does not have its own flag in conn->bits, yet we need
+ to signal that CURLPROXY_HTTPS is not used for this connection */
+ conn->http_proxy.proxytype = CURLPROXY_HTTP;
}
out:
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 120/411: base64: also build for pop3 and imap, (continued)
- [gnurl] 120/411: base64: also build for pop3 and imap, gnunet, 2021/01/12
- [gnurl] 89/411: libssh2: pass on the error from ssh_force_knownhost_key_type, gnunet, 2021/01/12
- [gnurl] 119/411: base64: enable in build with SMTP, gnunet, 2021/01/12
- [gnurl] 122/411: http: consolidate nghttp2_session_mem_recv() call paths, gnunet, 2021/01/12
- [gnurl] 115/411: lib: fix -Wassign-enum warnings, gnunet, 2021/01/12
- [gnurl] 118/411: curl_mime_headers.3: fix the example's use of curl_slist_append, gnunet, 2021/01/12
- [gnurl] 113/411: url: use blank credentials when using proxy w/o username and password, gnunet, 2021/01/12
- [gnurl] 136/411: ftp: a 550 response to SIZE returns CURLE_REMOTE_FILE_NOT_FOUND, gnunet, 2021/01/12
- [gnurl] 134/411: curl: make glob_match_url use dynbuf, gnunet, 2021/01/12
- [gnurl] 105/411: CI/azure: add test number to title for display in analytics, gnunet, 2021/01/12
- [gnurl] 87/411: http_proxy: do not crash with HTTPS_PROXY and NO_PROXY set,
gnunet <=
- [gnurl] 102/411: tests: remove pipelining tests, gnunet, 2021/01/12
- [gnurl] 126/411: dynbuf: provide curlx_ names for reuse by the curl tool, gnunet, 2021/01/12
- [gnurl] 121/411: HISTORY: mention alt-svc added in 2019, gnunet, 2021/01/12
- [gnurl] 96/411: easygetopt: pass a valid enum to avoid compiler warning, gnunet, 2021/01/12
- [gnurl] 94/411: tool: update --help with categories, gnunet, 2021/01/12
- [gnurl] 104/411: altsvc: clone setting in curl_easy_duphandle, gnunet, 2021/01/12
- [gnurl] 112/411: travis: add a build using libressl (from git master), gnunet, 2021/01/12
- [gnurl] 131/411: imap: set cselect_bits to CURL_CSELECT_IN initially, gnunet, 2021/01/12
- [gnurl] 128/411: runtests: allow creating files without newlines, gnunet, 2021/01/12
- [gnurl] 147/411: TODO: add PR reference for native IDN support on macOS, gnunet, 2021/01/12