Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] curl: backport fix for crash with NO_PROXY
Date: Fri, 11 Sep 2020 20:38:06 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-24831@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages curl-fix-no-proxy
https://github.com/void-linux/void-packages/pull/24831

curl: backport fix for crash with NO_PROXY
Backported from https://github.com/curl/curl/commit/3eff1c5092e542819ac7e6454a70c94b36ab

A patch file from https://github.com/void-linux/void-packages/pull/24831.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-curl-fix-no-proxy-24831.patch --]
[-- Type: text/x-diff, Size: 3090 bytes --]

From 7026c36ae4e0631db2d9f12941d1ecc8704900c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sat, 12 Sep 2020 01:36:22 +0700
Subject: [PATCH] curl: backport fix for crash with NO_PROXY

Backported from https://github.com/curl/curl/commit/3eff1c5092e542819ac7e6454a70c94b36ab
---
 srcpkgs/curl/patches/fix-crash-no-proxy.patch | 54 +++++++++++++++++++
 srcpkgs/curl/template                         |  2 +-
 2 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/curl/patches/fix-crash-no-proxy.patch

diff --git a/srcpkgs/curl/patches/fix-crash-no-proxy.patch b/srcpkgs/curl/patches/fix-crash-no-proxy.patch
new file mode 100644
index 00000000000..a1b763ce1e0
--- /dev/null
+++ b/srcpkgs/curl/patches/fix-crash-no-proxy.patch
@@ -0,0 +1,54 @@
+From 3eff1c5092e542819ac7e6454a70c94b36ab2a40 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Ba=C5=A1ti?= <mbasti@redhat.com>
+Date: Thu, 27 Aug 2020 23:09:56 +0200
+Subject: [PATCH] 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 d342c4e6986..2f02a0a16a3 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:
diff --git a/srcpkgs/curl/template b/srcpkgs/curl/template
index b9301476049..08629c4f93e 100644
--- a/srcpkgs/curl/template
+++ b/srcpkgs/curl/template
@@ -1,7 +1,7 @@
 # Template file for 'curl'
 pkgname=curl
 version=7.72.0
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="ac_cv_sizeof_off_t=8 --enable-threaded-resolver --enable-ipv6
  $(vopt_with rtmp) $(vopt_with gssapi) $(vopt_enable ldap) $(vopt_with gnutls)

             reply	other threads:[~2020-09-11 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 18:38 sgn [this message]
2020-09-11 23:02 ` [PR PATCH] [Merged]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-24831@inbox.vuxu.org \
    --to=sgn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).