summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2018-11-22 03:59:41 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2018-11-22 09:58:34 +0100
commit90720d0139feaf7421344073430d2a6f5ecbb231 (patch)
treefdde6914e1aee1b1b82512a6217fa7fab0a26056 /pkgs
parentc31cb577aed1e94e467ea1d6455fc275946d3b2d (diff)
downloadnixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.tar
nixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.tar.gz
nixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.tar.bz2
nixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.tar.lz
nixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.tar.xz
nixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.tar.zst
nixpkgs-90720d0139feaf7421344073430d2a6f5ecbb231.zip
curl: cherry-pick upstream patch for ipv6 url parsing
Upstream bug: curl/curl#3218.

This causes nixos/tests/ipv6.nix to fix since the last staging merge.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/curl/default.nix5
-rw-r--r--pkgs/tools/networking/curl/fix-ipv6-url-parsing.patch54
2 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index dac92f98223..42ea641afb6 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -34,6 +34,11 @@ stdenv.mkDerivation rec {
     sha256 = "084niy7cin13ba65p8x38w2xcyc54n3fgzbin40fa2shfr0ca0kq";
   };
 
+  patches = [
+    # Cherry picked fix for https://github.com/curl/curl/issues/3218
+    ./fix-ipv6-url-parsing.patch
+  ];
+
   outputs = [ "bin" "dev" "out" "man" "devdoc" ];
   separateDebugInfo = stdenv.isLinux;
 
diff --git a/pkgs/tools/networking/curl/fix-ipv6-url-parsing.patch b/pkgs/tools/networking/curl/fix-ipv6-url-parsing.patch
new file mode 100644
index 00000000000..8a74b27ce7f
--- /dev/null
+++ b/pkgs/tools/networking/curl/fix-ipv6-url-parsing.patch
@@ -0,0 +1,54 @@
+From b28094833a971870fd8c07960b3b12bf6fbbaad3 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Fri, 2 Nov 2018 15:11:16 +0100
+Subject: [PATCH] URL: fix IPv6 numeral address parser
+
+Regression from 46e164069d1a52. Extended test 1560 to verify.
+
+Reported-by: tpaukrt on github
+Fixes #3218
+Closes #3219
+---
+ lib/urlapi.c            | 8 ++++++--
+ tests/libtest/lib1560.c | 9 +++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/lib/urlapi.c b/lib/urlapi.c
+index c53e523434..18a6076fff 100644
+--- a/lib/urlapi.c
++++ b/lib/urlapi.c
+@@ -499,8 +499,12 @@ static CURLUcode parse_port(struct Curl_URL *u, char *hostname)
+      (']' == endbracket)) {
+     /* this is a RFC2732-style specified IP-address */
+     portptr = &hostname[len];
+-    if (*portptr != ':')
+-      return CURLUE_MALFORMED_INPUT;
++    if(*portptr) {
++      if(*portptr != ':')
++        return CURLUE_MALFORMED_INPUT;
++    }
++    else
++      portptr = NULL;
+   }
+   else
+     portptr = strchr(hostname, ':');
+diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c
+index e0faa12b29..57469a9063 100644
+--- a/tests/libtest/lib1560.c
++++ b/tests/libtest/lib1560.c
+@@ -128,6 +128,15 @@ struct querycase {
+ };
+ 
+ static struct testcase get_parts_list[] ={
++  {"http://[fd00:a41::50]:8080",
++   "http | [11] | [12] | [13] | [fd00:a41::50] | 8080 | / | [16] | [17]",
++   CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
++  {"http://[fd00:a41::50]/",
++   "http | [11] | [12] | [13] | [fd00:a41::50] | [15] | / | [16] | [17]",
++   CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
++  {"http://[fd00:a41::50]",
++   "http | [11] | [12] | [13] | [fd00:a41::50] | [15] | / | [16] | [17]",
++   CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
+   {"https://[::1%252]:1234",
+    "https | [11] | [12] | [13] | [::1%252] | 1234 | / | [16] | [17]",
+    CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},