]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
eliminate a race condition in Curl_resolv_timeout()
authorKamil Dudka <kdudka@redhat.com>
Sun, 4 Apr 2010 21:34:24 +0000 (23:34 +0200)
committerKamil Dudka <kdudka@redhat.com>
Sun, 4 Apr 2010 21:34:24 +0000 (23:34 +0200)
CHANGES
lib/hostip.c

diff --git a/CHANGES b/CHANGES
index e8883c4719092fa1ce96607c3dc3d71aa8635b98..17a4d5991d7179d1a1b12bd5f309781d3c168f16 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@
 
                                   Changelog
 
+Kamil Dudka (4 Apr 2010)
+- Eliminated a race condition in Curl_resolv_timeout().
+
 Daniel Stenberg (1 Apr 2010)
 - Matt Wixson found and fixed a bug in the SCP/SFTP area where the code
   treated a 0 return code from libssh2 to be the same as EAGAIN while in
index e34fd5a99afd58c5ccf93694c412f6e508ff8e5e..9255f6a202b08775208f2689524845482560268e 100644 (file)
@@ -628,6 +628,9 @@ int Curl_resolv_timeout(struct connectdata *conn,
 clean_up:
 
   if (timeout > 0) {
+    if(!prev_alarm)
+      /* deactivate a possibly active alarm before uninstalling the handler */
+      alarm(0);
 
 #ifdef HAVE_SIGACTION
     if(keep_copysig) {
@@ -664,8 +667,6 @@ clean_up:
       else
         alarm((unsigned int)alarm_set);
     }
-    else
-      alarm(0); /* just shut it off */
   }
 #endif /* USE_ALARM_TIMEOUT */