pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/47610: curl: fix NULL pointer reference when closing an unused multi handle



>Number:         47610
>Category:       pkg
>Synopsis:       curl: fix NULL pointer reference when closing an unused multi 
>handle
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 03 11:45:00 +0000 2013
>Originator:     dieter roelants
>Release:        NetBSD 6.99.17
>Organization:
>Environment:
pkgsrc ~-current
Architecture: x86_64
Machine: amd64
>Description:
        I get a lot of core dumps lately from software using
        enlightenment libs (packaged in wip). They all trace back
        to the curl_multi_cleanup function. This was fixed by (curl)
        upstream, but is not in the latest release.
>How-To-Repeat:
        Install and run wip/e17 and see lots of core files.
>Fix:
        Apply the upstream patch:
Index: www/curl/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/curl/Makefile,v
retrieving revision 1.124
diff -u -u -r1.124 Makefile
--- www/curl/Makefile   11 Feb 2013 12:20:43 -0000      1.124
+++ www/curl/Makefile   3 Mar 2013 11:32:07 -0000
@@ -1,6 +1,7 @@
 # $NetBSD: Makefile,v 1.124 2013/02/11 12:20:43 wiz Exp $
 
 DISTNAME=      curl-7.29.0
+PKGREVISION=   1
 CATEGORIES=    www
 MASTER_SITES=  http://curl.haxx.se/download/ \
                ftp://ftp.sunet.se/pub/www/utilities/curl/
Index: www/curl/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/www/curl/distinfo,v
retrieving revision 1.82
diff -u -u -r1.82 distinfo
--- www/curl/distinfo   11 Feb 2013 12:20:43 -0000      1.82
+++ www/curl/distinfo   3 Mar 2013 11:32:07 -0000
@@ -4,3 +4,4 @@
 RMD160 (curl-7.29.0.tar.bz2) = 50c2ee716736dc0f1de26e032f525e7511912b95
 Size (curl-7.29.0.tar.bz2) = 2556495 bytes
 SHA1 (patch-aa) = 07e12cd0576b87cfed74a6a2bf8dd42cb2f5a570
+SHA1 (patch-lib_multi.c) = ead077ecdb819081e7a271feb6e249a20e025f75
Index: www/curl/patches/patch-lib_multi.c
===================================================================
RCS file: www/curl/patches/patch-lib_multi.c
diff -N www/curl/patches/patch-lib_multi.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ www/curl/patches/patch-lib_multi.c  3 Mar 2013 11:32:07 -0000
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Fix NULL pointer reference when closing an unused multi handle.
+(upstream commit da3fc1ee91de656a30f3a12de394bcba55119872)
+
+--- lib/multi.c.orig   2013-02-05 22:01:40.000000000 +0000
++++ lib/multi.c
+@@ -1773,10 +1773,12 @@ CURLMcode curl_multi_cleanup(CURLM *mult
+     /* 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);
++      Curl_close(multi->closure_handle);
++    }
+     multi->closure_handle = NULL;
+ 
+     Curl_hash_destroy(multi->sockhash);



Home | Main Index | Thread Index | Old Index