]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi: prevent NULL pointer dereference
authorDaniel Stenberg <daniel@haxx.se>
Fri, 18 Jun 2010 21:46:09 +0000 (23:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 18 Jun 2010 21:46:09 +0000 (23:46 +0200)
My additional call to Curl_pgrsUpdate() would sometimes get
called even though there's no connection (left) so a NULL pointer
would get passed, causing a segfault.

lib/multi.c

index b42f68d0f2f98be87b481d1c761e060d9785e192..ea284b3f300f3e1ed41be6f92d1f54bfdc1ced71 100644 (file)
@@ -1527,7 +1527,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
 
         multistate(easy, CURLM_STATE_COMPLETED);
       }
-      else if(Curl_pgrsUpdate(easy->easy_conn))
+      /* if there's still a connection to use, call the progress function */
+      else if(easy->easy_conn && Curl_pgrsUpdate(easy->easy_conn))
         easy->result = CURLE_ABORTED_BY_CALLBACK;
     }
   } while(0);