]> granicus.if.org Git - curl/commitdiff
Dmitriy Sergeyev found a SIGSEGV with his test04.c example posted on 7 Nov
authorDaniel Stenberg <daniel@haxx.se>
Thu, 9 Nov 2006 21:54:33 +0000 (21:54 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Nov 2006 21:54:33 +0000 (21:54 +0000)
2006. It turned out we wrongly assumed that the connection cache was present
when tearing down a connection.

CHANGES
RELEASE-NOTES
lib/url.c

diff --git a/CHANGES b/CHANGES
index 154de4b1226deab286b6c01cf18acb59dec74717..d026cca0b77e3f42283f20b2a1afa06b4fe6076e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,10 @@
                                   Changelog
 
 Daniel (9 November 2006)
+- Dmitriy Sergeyev found a SIGSEGV with his test04.c example posted on 7 Nov
+  2006. It turned out we wrongly assumed that the connection cache was present
+  when tearing down a connection.
+
 - Ciprian Badescu found a SIGSEGV when doing multiple TFTP transfers using the
   multi interface, but I could also repeat it doing multiple sequential ones
   with the easy interface. Using Ciprian's test case, I could fix it.
index 68c4e9953280c3b6fb5c7e1295594bdda2e86fc6..4e409be840b0efe8702d7795c17ccb3bda4b17c2 100644 (file)
@@ -20,6 +20,8 @@ This release includes the following bugfixes:
    was not enabled
  o multiple TFTP transfers on the same (easy or multi) handle could cause a
    crash
+ o SIGSEGV when disconnecting on a transfer on a re-used handle when the
+   host name didn't resolve
 
 Other curl-related news:
 
@@ -33,6 +35,6 @@ This release would not have looked like this without help, code, reports and
 advice from friends like these:
 
  James Housley, Olaf Stueben, Yang Tse, Gisle Vanem, Bradford Bruce,
- Ciprian Badescu
+ Ciprian Badescu, Dmitriy Sergeyev
 
         Thanks! (and sorry if I forgot to mention someone)
index c5ce746c0e9a4dcfcaaa1da4d6bccd32f5633346..cc3c87eb92793048b5bdb51d5236e4fb933240cf 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1804,7 +1804,10 @@ CURLcode Curl_disconnect(struct connectdata *conn)
   if(-1 != conn->connectindex) {
     /* unlink ourselves! */
     infof(data, "Closing connection #%ld\n", conn->connectindex);
-    data->state.connc->connects[conn->connectindex] = NULL;
+    if(data->state.connc)
+      /* only clear the table entry if we still know in which cache we
+         used to be in */
+      data->state.connc->connects[conn->connectindex] = NULL;
   }
 
 #ifdef USE_LIBIDN