From e2abed75ecc34f9da397f622f89edd8fdd5d405e Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 10 Feb 2013 13:43:10 -0500 Subject: [PATCH] Revert "Revert "curl: Update to version 7.29.0."" This reverts commit ec4f56b3473a07cbaf7194d8ea374c4514499f73. With the added patch, the curl segfault seems to be fixed. --- pkgs/tools/networking/curl/default.nix | 6 ++-- .../curl/fix-curl-multi-cleanup.patch | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 pkgs/tools/networking/curl/fix-curl-multi-cleanup.patch diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 028b672380cf..88cdab38aafd 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -10,11 +10,11 @@ assert sslSupport -> openssl != null; assert scpSupport -> libssh2 != null; stdenv.mkDerivation rec { - name = "curl-7.28.0"; + name = "curl-7.29.0"; src = fetchurl { url = "http://curl.haxx.se/download/${name}.tar.bz2"; - sha256 = "b7f510db60f520ba0bc8a39cccee7e913362205b4a7709e16af2cba14093099b"; + sha256 = "0bw3sclhjqb2zwgcp6njjpaca62rwlj2mrw2r9wic47sqsxfhy4x"; }; # Zlib and OpenSSL must be propagated because `libcurl.la' contains @@ -55,6 +55,8 @@ stdenv.mkDerivation rec { inherit sslSupport openssl; }; + patches = [ ./fix-curl-multi-cleanup.patch ]; + preConfigure = '' sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure ''; diff --git a/pkgs/tools/networking/curl/fix-curl-multi-cleanup.patch b/pkgs/tools/networking/curl/fix-curl-multi-cleanup.patch new file mode 100644 index 000000000000..f6e42040cb8e --- /dev/null +++ b/pkgs/tools/networking/curl/fix-curl-multi-cleanup.patch @@ -0,0 +1,32 @@ +commit 249c981407b8c52edf2b0833a78cd3d3d8bd2823 +Author: Shea Levy +Date: Sun Feb 10 13:27:10 2013 -0500 + + curl_multi_cleanup: Don't try to cleanup the closure_handle if it is NULL. + + Without this, curl_multi_cleanup(curl_multi_init()) segfaults. + + Signed-off-by: Shea Levy + +diff --git a/lib/multi.c b/lib/multi.c +index fa0afb9..5b9d0bb 100644 +--- a/lib/multi.c ++++ b/lib/multi.c +@@ -1773,11 +1773,13 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle) + /* Close all the connections in the connection cache */ + close_all_connections(multi); + +- multi->closure_handle->dns.hostcache = multi->hostcache; +- Curl_hostcache_clean(multi->closure_handle); ++ if (multi->closure_handle) { ++ multi->closure_handle->dns.hostcache = multi->hostcache; ++ Curl_hostcache_clean(multi->closure_handle); + +- Curl_close(multi->closure_handle); +- multi->closure_handle = NULL; ++ Curl_close(multi->closure_handle); ++ multi->closure_handle = NULL; ++ } + + Curl_hash_destroy(multi->sockhash); + multi->sockhash = NULL;