]> granicus.if.org Git - curl/commitdiff
- Bug report #2416182 titled "crash in ConnectionExists when using
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Dec 2008 23:52:56 +0000 (23:52 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 11 Dec 2008 23:52:56 +0000 (23:52 +0000)
  duphandle+curl_mutli" (http://curl.haxx.se/bug/view.cgi?id=2416182) showed
  that curl_easy_duphandle() wrongly also copied the pointer to the connection
  cache, which was plain wrong and caused a segfault if the handle would be
  used in a different multi handle than the handle it was duplicated from.

CHANGES
RELEASE-NOTES
lib/easy.c

diff --git a/CHANGES b/CHANGES
index b428af81c5ef4a6be1f8b4f7e10f4b21b114596c..8398d27e9a0850e394c9991dd565ffb3a1e45b45 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,13 @@
 
                                   Changelog
 
+Daniel Stenberg (12 Dec 2008)
+- Bug report #2416182 titled "crash in ConnectionExists when using
+  duphandle+curl_mutli" (http://curl.haxx.se/bug/view.cgi?id=2416182) showed
+  that curl_easy_duphandle() wrongly also copied the pointer to the connection
+  cache, which was plain wrong and caused a segfault if the handle would be
+  used in a different multi handle than the handle it was duplicated from.
+
 Daniel Stenberg (11 Dec 2008)
 - Keshav Krity found out that libcurl failed to deal with dotted IPv6
   addresses if they were very long (>39 letters) due to a too strict address
index da0d98ba98e895976116cc75c812de7a3a8a418c..5d7de12530a9905c657e07f2d1a90218f6fc38a9 100644 (file)
@@ -28,6 +28,7 @@ This release includes the following bugfixes:
  o 550 response from SIZE no longer treated as missing file
  o ftps:// control connections now use explicit protection level
  o dotted IPv6 addresses longer than 39 bytes failed
+ o curl_easy_duphandle() doesn't try to duplicate the connection cache pointer
 
 This release includes the following known bugs:
 
index 2c2490142908ffc69764d65ac959c47a0c063f7e..ae669f9bebd6ddc622f9fbb510b8d664fbb7e96a 100644 (file)
@@ -624,13 +624,8 @@ CURL *curl_easy_duphandle(CURL *incurl)
     if(Curl_dupset(outcurl, data) != CURLE_OK)
       break;
 
-    if(data->state.used_interface == Curl_if_multi)
-      outcurl->state.connc = data->state.connc;
-    else
-      outcurl->state.connc = Curl_mk_connc(CONNCACHE_PRIVATE, -1);
-
-    if(!outcurl->state.connc)
-      break;
+    /* the connection cache is setup on demand */
+    outcurl->state.connc = NULL;
 
     outcurl->state.lastconnect = -1;